klange changed the topic of #osdev to: Operating System Development || Don't ask to ask---just ask! || For 3+ LoC, use a pastebin (for example https://gist.github.com/) || Stats + Old logs: http://osdev-logs.qzx.com New Logs: https://libera.irclog.whitequark.org/osdev || Visit https://wiki.osdev.org and https://forum.osdev.org || Books: https://wiki.osdev.org/Books
<pie_> i dont really understand the user-mode linux skas0 execution model...
<nikolar> i don't even know what that is, so you have one up on me
<pie_> its...the way the host side mapping is implemented
<pie_> there's 3 variations
<pie_> skas0 is the "newest" one;
<pie_> theres one called tt for thread tracing or something, one called skas3, (skas is "separate kernel address space(s?)", whatever that means) , and one calles skas0 - where the 0 is for "needs zero host kernel patches"
<clever> pie_: "whatever that means", its related to preventing the guest userland from accessing the kernel memory, which is also host userland memory
<nikolar> How does that work
<clever> nikolar: thats the part i'm fuzzy on, and it sounds like the 3 variants do it differently
<clever> but the "separate kernel address space" in skas, implies something like maybe having the kernel in a dedicated process, and IPC'ing between the fake userland and fake kernel?
<pie_> the part everyone is fuzzy on
<pie_> anyway it shoudl clear up for you , its explained in the book one sec
<pie_> look at him guessing it<clever> but the "separate kernel address space" in skas, implies something like maybe having the kernel in a dedicated process, and IPC'ing between the fake userland and fake kernel?
<pie_> i think something like that yeah
<pie_> clever: https://libgen.li/edition.php?id=137275705 page 194 "uml execution modes"
<bslsk05> ​libgen.li: Library Genesis
<karenw> I get a SSL_ERROR_RX_RECORD_TOO_LONG on accessing that link
* pie_ shrugs cluelessly
<pie_> maybe you have an institution firewall or something meddling?
<karenw> Nah, just a normal home network
<nikolar> not sure you're supposed to be pasting links like that here kek
<pie_> could also be german downloadable content meddling? :P
<karenw> I'm going to blame the UK age-verification law. It's the current boogeyman to blame everything on.
<karenw> https://www.ssllabs.com/ssltest/analyze.html?d=libgen.li That site has really modern TLS support, so super weird I can't connect.
<clever> it works fine in my firefox
<karenw> Yeah I think it's blocked by my ISP. KEKW
karenw_ has joined #osdev
karenw has quit [Killed (lead.libera.chat (Nickname regained by services))]
karenw_ is now known as karenw
<nikolar> well it is libgen
<nikolar> i am not surprised
<nikolar> uml is pretty funky
<nikolar> i like it
<nikolar> pie_: have you managed to get uml running on modern linux?
karenw has quit [Ping timeout: 265 seconds]
<pie_> havent tried, but its mainlined
<pie_> so i dont see why it wouldnt work
<nikolar> oh it is?
<pie_> im making the assumption that you didnt know that (yeah the website is old or wahtever)
<nikolar> i guess i coulud try building a kernel
karenw has joined #osdev
<pie_> theres a page on the kernel docs
<pie_> i dont strictly speaking need to run it for what im doing right now but its still probably a good thing to have in the toolbox eventually
<pie_> or what im trying to do anyway
<nikolar> i just want to mess with it
<pie_> i just need it as a reference
<pie_> hehe
<nikolar> what are you trying to do
<pie_> maybe try doing user mode xv6
edr has quit [Quit: Leaving]
<nikolar> funky
<nikolar> also *a lot* of work i imagine
<clever> xv6?
<pie_> i expect it to be relatively easy
<pie_> if its too hard ill probably have to drop it
<pie_> clever: its a small unix-like teaching OS https://github.com/mit-pdos/xv6-riscv
<bslsk05> ​mit-pdos/xv6-riscv - Xv6 for RISC-V (3123 forks/8341 stargazers/NOASSERTION)
<pie_> with some excellent youtube lectures
<pie_> *youtube walkthrough of the code
<pie_> theres also a pdf though
<clever> why does it need UML?
<pie_> it doesnt
<pie_> i want to do for xv6 what uml does for linux
<clever> ahhh
<bslsk05> ​'xv6 Kernel-1: Intro and Overview' by hhp3
<nikolar> hm i need a rootfs from somewhere
<nikolar> Kernel panic - not syncing: Requested init /bin/bash failed (error -8).
<nikolar> i wonder what error -8 is
<clever> run "perror 8"
<clever> from the mysql package
<clever> c2d ~ # perror 8
<clever> OS error code 8: Exec format error
<pie_> btw i think i saw a link for precompiled uml or uml images or something on the uml site somewhere maybe
<pie_> dunno if its up to date
<clever> so /bin/bash is not a valid executable, it may be an elf when you dont have elf support, or it may be an x86 binary on a risc-v kernel
<nikolar> oh duh it's not /bin/bash it's /usr/bin/bash
<nikolar> oh still no worky
<clever> are you sure?
<clever> what does `file bin/bash` report?
<nikolar> Initialized stdio console driver
<nikolar> Using a channel type which is configured out of UML
<nikolar> setup_one_line failed for device 1 : failed to parse channel pair
<nikolar> getting this, earlier in the boot
<nikolar> > /usr/bin/bash: ELF 64-bit LSB pie executable,
<nikolar> i am probably missing something stupid from the config
<clever> and if you run file on the UML kernel?
<nikolar> file?
<nikolar> as in file the command
<clever> yes
<nikolar> same thing
<clever> what arguments did you run UML with?
<nikolar> ./linux rootfstype=hostfs rw init=$(which bash)
<nikolar> to be fair, no clue if i need something more
<clever> what is the output of `ldd ./linux` ?
<nikolar> linux-gate.so.1 (0xf7f58000)
<nikolar> libc.so.6 => /usr/lib32/libc.so.6 (0xf7cca000)
<nikolar> /lib/ld-linux.so.2 => /usr/lib/ld-linux.so.2 (0xf7f5a000)
<clever> you lied
<nikolar> i did?
<clever> thats a 32bit kernel
<clever> you claimed "file linux" gave the same as "file /usr/bin/bash"
<clever> bash is 64bit, but the UML kernel is 32bit
<nikolar> oh i misunderstood you, i ran file as the init
<nikolar> not `file linux`
<clever> 2025-08-06 22:16:44 < clever> and if you run file on the UML kernel?
<clever> as-in, the kernel built in UML mode
<nikolar> well that can be interpreted both ways :)
<nikolar> > linux: ELF 32-bit LSB executable,
<nikolar> yeah you're right
<clever> yep
<clever> so you can only run a 32bit bash
<nikolar> hm is there a um64 arch or something
<clever> dont know
<clever> id say, find a way to pass it a disk image
<clever> creating a 32bit rootfs is fairly simple
<nikolar> i will, i just want to get something running first
<nikolar> preferably 64 bit
<clever> what does ./linux --help return?
<nikolar> nothing particularly interesting
<clever> nothing about block devices?
<pie_> every uml tutorial i opened so far links to rootfs on the internet
<clever> pie_: the rootfs is the simplest part, and nix can also help with it
<clever> nikolar: what happens if you just run "./linux root=./disk.img rw" ?
<nikolar> let me grab a random 32 bit image first then
<bslsk05> ​xeiaso.net: Making sure you're not a bot!
<clever> ah wait, there is an extra rootfs=, thats perfect
<clever> hostfs*
<nikolar> extra?
<clever> so you can just do: ./linux rootfstype=hostfs rw init=/bin/bash rootfs=root/
<clever> and then just drop a bash at root/bin/bash
<pie_> Open alpinelinux.org. Click on Downloads. Scroll down to where it lists the MINI ROOT FILESYSTEM. Right-click on the x86_64 link and copy it. As of the time of writing this post, the latest URL for this is:
<bslsk05> ​alpinelinux.org: downloads | Alpine Linux
<clever> nikolar: extra, as-in something fancy UML added, so you dont need to generate disk images
<nikolar> pie_: the problem is that i don't know how to build a 64 bit kernel
<nikolar> so a 64 bit rootfs isn't particularly helpful :)
<clever> nikolar: one sec
<pie_> well x86 is listed?
<bslsk05> ​github.com: nixpkgs/pkgs/stdenv/linux/bootstrap-files/i686-unknown-linux-gnu.nix at master · NixOS/nixpkgs · GitHub
<clever> nikolar: this is the URL to a static busybox binary, that is x86 32bit
<nikolar> handy
<clever> you can just rename it to something like root/bin/sh, and then use the ./linux i gave above
<nikolar> heh getting error -2 now
<clever> what is the exact command you ran?
<nikolar> linux uml_dir=.uml rootfstype=hostfs rw init=/sh rootfs=root/
<nikolar> uml_dir is just there so it doesn't dump in my ~
<clever> ls -lh root/sh
<nikolar> -rwxr-xr-x 1 nikola nikola 193K Jan 29 2024 root/sh*
<clever> `file root/sh` ?
<clever> ah wait, typo
<clever> hostfs=<root dir>,<flags>,...
<clever> its hostfs=root/
<clever> i made the typo when i first mentioned it, noticed it, then made the same typo on the example cmd!
<nikolar> heh nice
<clever> so it was looking at /sh on the host
<nikolar> hm
<nikolar> linux uml_dir=.uml rootfstype=hostfs hostfs=root/ rw init=/sh
<nikolar> VFS: Cannot open root device "98:0" or unknown-block(98,0): error -9
<nikolar> Please append a correct "root=" boot option; here are the available partitions:
<clever> OS error code 9: Bad file descriptor
<clever> my guess then, just ditch the hostfs= and use an absolute path to sh
<clever> init=$(realpath root/sh)
<clever> its static, so it doesnt really need to be in the right place
<nikolar> that seems to have worked, yea
<nikolar> wonder why it doesn't like the hostfs with a path
<clever> we may be misunderstanding how it works
* pie_ strawmans
<pie_> the real travesty of dynamic linking is that people now programs are fragile
<pie_> *now think
<clever> nikolar: next trick, do `mkfs.ext4 -d root/ disk.bin`
<nikolar> heh
<clever> then you can just root=./disk.bin
<pie_> is rootfstype=hostfs correct
<clever> pie_: thats telling UML to use a special fs driver, where it then mounts the host / to guest / by default, i think
<clever> so the guest can just seamlessly access any host file
<pie_> its not explicitly mentioned in the pasted help but i guess its implied
<pie_> ok *shrugs*
<clever> it might be doing nothing
<nikolar> linux uml_dir=.uml root=./disk.img rw init=/bin/sh
<nikolar> nope
<clever> it may lack ext4, try mkfs.ext2 or 3?
<clever> did it give an clear errors?
<nikolar> VFS: Cannot open root device "./disk.bin" or unknown-block(0,0): error -6
<clever> was it disk.bin or disk.img?
<nikolar> i have both heh
<nikolar> neither works
<clever> nuclear option, prefix that command with strace!
<clever> "strace linux uml_dir=.uml root=./disk.img rw init=/bin/sh"
<nikolar> that file is never opened heh
<nikolar> its name is just printed once
<clever> its probably doing the standard linux thing, where it expects it to exist within the guest
<nikolar> re root
<nikolar> > If you configure a number of block
<nikolar> i guess we need to configure block devices
<nikolar> heh yea that
<clever> i assumed that was a host config, but the ubd could stand for user block device
<clever> so you need to configure it in a UML specific way
<clever> http://uml.harlowhill.com/ oh god, that font
<bslsk05> ​uml.harlowhill.com: Welcome to nginx on Debian!
<bslsk05> ​www.kernel.org: UML HowTo — The Linux Kernel documentation
<nikolar> it's lovely
<clever> you need to put a `ubd0=root_fs_whatever' switch on the linux command
<clever> so i'm thinking, `root=/dev/ubd0 ubd0=disk.img`
<nikolar> /dev/root: Can't open blockdev
<nikolar> VFS: Cannot open root device "/dev/ubd0" or unknown-block(0,0): error -6
<nikolar> hm nope
<nikolar> linux uml_dir=.uml root=/dev/ubd0 ubd0=disk.img rw init=/sh
<clever> can you pastebin the full strace output?
<nikolar> here you go
<clever> other then 2 files within .uml, its not trying to open anything really...
<clever> oh, but it did fork out a child
<clever> repeat with `strace -f` to follow children
<nikolar> oh right forking
<nikolar> Checking that ptrace can change system call numbers...ptrace: Operation not permitted
<nikolar> nested ptrace heh
<nikolar> guess it doesn't like that
<pie_> fucking ptrace, doh
<clever> what is the exact command that caused that error?
<pie_> strace i think has a bpf mode
<pie_> idk if that helps
<pie_> clever: uml does use ptrace
<clever> ahhhh
<clever> so you cant trace the UML itself
<pie_> well, bpf tracing?
<clever> but it may have still tried to open disk.img before failure, pastebin the logs anyways
<nikolar> it died really quickly, it's basically the first thing it does
<nikolar> checking if it can use ptrace
<pie_> nikolar: try --seccomp-bpf?
<nikolar> pie_: i mean it doesn't die with just --seccomp-bpf
<nikolar> but it's still not doing anything
<clever> write(1, " [<080731e6>] ? new_thread_handl"..., 45) = 45
<clever> nikolar: that looks like a kernel stack dump, what was on stdout?
<pie_> in case of misunderstanding; _add_ --seccomp-bpf to whatever you were doing before (and make sure its in the strace part :P)
<clever> you can use `strace -o logfile -f` so it goes to a file, leaving stdout untouched
<nikolar> yeah that's what i was doing
<clever> that implies it is running some of the guest kernel
<clever> so the error may be useful?
<nikolar> the last bit of it, yea
<clever> ah, so strace did work
<clever> it also clearly says, that it can handle ext2/3/4
<nikolar> indeed it does
<nikolar> ok well one mystery solved
<nikolar> it wasn't configured with ubd support lol
<nikolar> i can get into the image now
<clever> thatll do it!
<nikolar> yup heh
<nikolar> now i just need to figure out a 64 bit kernel
<nikolar> and the hostfs weirdness
<clever> i suspect that hostfs may not be a prefix but a filter
<clever> basically, if you set hostfs=/home/clever, then the guest must do `mount -t hostfs /home/clever/foo /anywhere`
<nikolar> right, who knows
<clever> maybe you can do `root=$(realpath root)` ?
<clever> and hostfs isnt needed, its purely to restrict it
<clever> along with rootfstype=hostfs
<nikolar> yea
<nikolar> that does seem to be working
<nikolar> ok 64 bit was a different config option apparentyl
<nikolar> let's see if it works now
<nikolar> yup, 64 bit works now
<clever> can you now run the host bash, and run uml within uml? lol
<nikolar> i can run the host bash
<nikolar> i doubt i can run uml in uml
<nikolar> because ptrace lol
<nikolar> i am running the alpine image from earlier though
da5id has quit [Quit: WeeChat 4.7.0]
karenw has quit [Ping timeout: 245 seconds]
j00ru has quit [Ping timeout: 248 seconds]
criswell has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
j00ru has joined #osdev
skipwich has quit [Remote host closed the connection]
skipwich_ has joined #osdev
skipwich_ is now known as skipwich
criswell has joined #osdev
criswell has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fgarcia has joined #osdev
fgarcia has quit [Max SendQ exceeded]
criswell has joined #osdev
criswell has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
steelswords94361 has quit [Quit: Ping timeout (120 seconds)]
steelswords94361 has joined #osdev
steelswords94361 has quit [Quit: Ping timeout (120 seconds)]
steelswords94361 has joined #osdev
goliath has joined #osdev
_whitelogger has joined #osdev
<ZetItUp> it's too early in the morning, didn't get any sound from spotify, started troubleshooting everything, even reinstalled drivers... it was muted.
agent314 has joined #osdev
netbsduser has joined #osdev
GeDaMo has joined #osdev
steelswords94361 has quit [Quit: Ping timeout (120 seconds)]
steelswords94361 has joined #osdev
Lucretia has joined #osdev
agent314 has quit [Ping timeout: 276 seconds]
<nikolar> Oh no
<zid> nikolar found a mirror
<nikolar> :|
<Mutabah> zid: Oof, that's cold
<zid> It was understated and subtle, compared to what he actually looks like Mutabah
xvmt has quit [Read error: Connection reset by peer]
xvmt has joined #osdev
bauen1 has quit [Ping timeout: 252 seconds]
Teukka has quit [Read error: Connection reset by peer]
Teukka has joined #osdev
Left_Turn has joined #osdev
<nikolar> trying to boot my distro on top of uml now
<nikolar> i don't get a console on tty0 though :(
<heat> uml is barely used
<heat> i will be surprised if it works
<nikolar> it does
<nikolar> it gets through the boot process, mostly
<nikolar> i can't check how far because i don't get a bash prompt
netbsduser has quit [Ping timeout: 276 seconds]
kristinam has quit [Server closed connection]
kristinam has joined #osdev
goliath has quit [Remote host closed the connection]
goliath has joined #osdev
sortiecat has joined #osdev
criswell has joined #osdev
vdamewood has quit [Quit: Life beckons]
bauen1 has joined #osdev
EmanueleDavalli has joined #osdev
Brnocrist has quit [Ping timeout: 252 seconds]
Brnocrist has joined #osdev
sortiecat has quit [Quit: Leaving]
vdamewood has joined #osdev
<klys> ok, if i made a chroot and mounted -t devtmpfs none /dev; in that chroot, then proceeded to rm -r dev; and came back to find most of /dev missing outside the chroot, proceeding to mknod /dev/nvme0n1 b 259 0; and find a disk image completely zeroed out, except it's still mounted and my data appears to be intact through the mount, is it safe to reboot?
<nikolar> huh well
criswell has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<heat> > proceeded to rm -r dev
<heat> don't do that
<heat> > and came back to find most of /dev
<heat> yes that's what happens
<heat> > mknod /dev/nvme0n1 b 259 0
<heat> is the device number correct? are you sure it's all zeroed out?
<zid> yea that was my only thought
<zid> that that's j ust the wrong node
EmanueleDavalli has quit [Read error: Connection reset by peer]
<pog> oops
<AmyMalik> ... xD?
EmanueleDavalli has joined #osdev
EmanueleDavalli has quit [Read error: Connection reset by peer]
<nikolar> oh i have a mostly booted linux environment using uml kek
<nikolar> even has networking!
<zid> underwear mode linux
<nikolar> kek i got this cursed thing working well enough that i can ssh into it as a regular user
<heat> under linux kernel operating mode linux
edr has joined #osdev
<nikolar> yes
<kof673> all this uml talk but not a diagram in sight
<kof673> strange new world
<nikolar> we don't do that kind of uml here
<nikolar> we aren't JAVA ENTERPRISE CLASS HIERARCHY enouhg
<zid> nikolar loves a diagram normally
<zid> in crayon, mainly
<heat> KernalFactory
<nikolar> kek uml is running the newer kernel than my hos
<nikolar> host
<heat> your hos
<heat> they use linux??
<zid> uml is for power-bottoms right?
<nikolar> it's so cursed, i love it
<zid> That's a yes
<nikolar> i don't even know what you said, so sure
<kof673> maybe the uml joke was all these diagrams and not a line of code in sight /s
<nikolar> huh til that python isn't in base arch packages
<heat> really?
<heat> that's pretty rare
<nikolar> it's probably gets pulled immediatelly with some other random package you install quickly
<nikolar> but it isn't, apparently
<zid> portage :(
<nikolar> portage?
<nikolar> s/it's/it/
<bslsk05> ​<nikolar*> it probably gets pulled immediatelly with some other random package you install quickly
<zid> gentoo's package manager, it's written in python
<nikolar> oh it is?
<nikolar> rip
<zid> yes :(
<nikolar> pacman for the win, (in c)
<zid> it's like git
<zid> but python instead of shell
<nikolar> kek
<heat> ?
<heat> git is also in C
<zid> it is now
<zid> most of the commands started as scripts
<zid> and slowly got ported to C as they matured
dinkelhacker has quit [Server closed connection]
dinkelhacker has joined #osdev
Yoofie6464463823 has joined #osdev
foxsecu has quit [Quit: ZNC 1.9.1 - https://znc.in]
<nikolar> Is portage getting ported to c
<zid> no but it isn't all python
<zid> at least
<zid> sometimes it exec's sha1sum!
<pog> $ echo zid | sha1sum -
<pog> c549287946a00262f59f1b8e35556523c92dda71 -
<pog> me too
<nikolar> Whoa
<nikolar> That's quality c right there
Arsen has quit [Server closed connection]
Arsen has joined #osdev
<pog> for now ;)
<zid> quality RUST soon no doubt
<zid> FEARLESS CONCURRENCY in your sha1
<nikolar> that's exactly what the world needs!
<pog> i wrote a threaded version of sha1sum in like 2009
<pog> wasn't that much faster and sometimes slower
<zid> is that even... possible
<nikolar> yeah i don't remember the details, but i don't expect it to be very paralellizible
<pog> one thread per input stream
<nikolar> it even works in relatively small chunks
<nikolar> oh that heh
<pog> it's not--it's entirel I/O bound
<zid> -j16 is cheating
<nikolar> kek
<nikolar> very much
<pog> iirc it would speed up dramatically on subsequent iterations of small files that would remain in the block cache
<pog> but that's not a likely usage scenario
<zid> but was the binary 4MB and did it take 30GB of diskspace to build
<pog> it wasn't in rust
<zid> and offer no way to debug it
<zid> see that's where you went wrong
<pog> it was in C and i used the openssl sha1
<zid> I've written md5 twice
<zid> never sha1
<pog> i wrote an impl of sha1 around the same time
<nikolar> i've yoinked a 100 linux sha1 impl
<nikolar> so it can't be that bad
<nikolar> line, not linux
<zid> they're all the same
<zid> xor some bits together and shuffle some arrays of b ytes
<pog> yeh it's always going to be faster than IO unless the compiler is incredibly stupid/malicious
<zid> depends what type of hash it is
<nikolar> have you tried tcc?
<zid> checksum hashes are designed to be quick though
<zid> but like, password hashes *should* be slow
<pog> yeh not crypto hashes
<pog> totally different animal
<heat> nikolar: ONE HUNDRED LINUX?!?
<heat> OH MAN THAT'S THE DREAM
<nikolar> ALL OF THE LINUCES
<heat> aktshually
<heat> no
<nikolar> [nikola@uml ~]$ uname -a
<nikolar> Linux uml 6.15.9-uml #27 Thu Aug 7 14:53:51 CEST 2025 x86_64 GNU/Linux
<nikolar> how do you like my uml kernel
<heat> $ git tag | wc -l
<heat> 894
<heat> we would need ONE THOUSAND LINUX
<heat> and it still wouldn't be enough for stable
<heat> considering LTS consumes some 300 or so tags each
<heat> TEN THOUSAND LINUX would be safer
<heat> maybe ONE HUNDRED THOUSAND LINUX
<heat> nikolar: not a fan sorry
<nikolar> Hey it's running a full distro now!
<pie_> <nikolar> i doubt i can run uml in uml
<pie_> <nikolar> because ptrace lol
<pie_> im not so sure about this
<zid> hehe pee trace
<pie_> the inner kernels ptrace might not be in the same scope as the outer kernels ptrace
<pie_> zid: ...hehe
<pie_> no water brb drinking my own kernel
<nikolar> Only one process can ptrace a different process
<nikolar> > UML was originally designed for the x86 instruction set, but has also been ported to others including IA-64 and PowerPC. [citation needed]
<nikolar> heat, it's been ported to itanium! ^
<AmyMalik> owoe?
<nikolar> owoe?
<pog> uwue
<nikolar> huehue
criswell has joined #osdev
<pie_> yes but the _inner_ ptrace is not the same ptrace? <nikolar> Only one process can ptrace a different process
<nikolar> hm i wonder how it's implemented
<nikolar> i still don't think it would work
<pie_> im not saying it would, im just not sure it wouldnt
<pie_> the question is does the inner system doing syscalls work
<zid> I'm assuming all the missing apostrophes go like 'im
<zid> It's more fun for me this way
<pie_> fuck 'im
* pie_ grug brained os developer
goliath has quit [Quit: SIGSEGV]
<nikolar> sure, but guest processes are still isolated and spawned into separate host processes
<nikolar> which means you need actual ptrace to mess with them
<pie_> i dont follow, but the syscall instruction is still a syscall instruction, so first the outer ptrace should get triggered
<pie_> my question is does it then get routed to the inner ptrace handler
<pie_> not explicitly by "i am the outer ptracer and i should give it ot the inner ptracer", but by "the handler for this event coincidentally happens to be the handler for ptrace in the inner kernel"
<nikolar> so both the outer guest and the inner guest are going to want to spawn host processes (outer directly, inner indirectly, but through outer)
<pie_> yeah
<nikolar> which means that outer will already have attached its ptrace to the inner's processes
<nikolar> and inner can't attach its ptrace
<pie_> but the inner ptrace goes through the inner kernel? it doesnt call an outer ptrace?
<pie_> the outer world knows nothing about the inner worlds API [citation needed]
<nikolar> i am not saying it does
<nikolar> but it will need to manage its processes
<pie_> <kof673> all this uml talk but not a diagram in sight
<nikolar> this uml is more fun anyway
<nikolar> screw uml
<zid> syscalls are allowed to fail because of resources not being available
<zid> I expect ptrace-ptrace-ptrace stacking to just stop working at one level
<nikolar> yea same
<nikolar> which is to say, no nesting uml
<heat> kof673: lol
<heat> underrated joke
<nikolar> oh you missed it earlier kek
<pie_> nikolar: i dont understand, but you are probably correct nevertheless
<nikolar> lol why
<nikolar> (why do you assume i am that is)
<zid> niko niko niko lar, anata ga omou yori kenou desu
<zid> niko niko niko lar, atama no deki ga chigau no de mondai wa nashi
<bslsk05> ​'Nico Nico Nii Remix 10 hs' by Tute Cisterna
<nikolar> lol where did you get that from
<zid> you were literally talking about wanting to go to a concert where that would be the #1 song and you don't recognise it, smh
<nikolar> kek
<pie_> he will break your nico nico kneecaps if you dont stop throwing shade
<nikolar> pie_: don't worry about him, he's just like taht
<pie_> no nico nico niicap breaking? :(
* pie_ dejectedly puts away the knuckledusters
<zid> nikolar: Did you figure out what it is yet lol
<nikolar> nope
<zid> wow even with the hint
<zid> that's nuts
<zid> ado - usseewa
<nikolar> i don't know the bloody lyrics lol
<zid> yea but I gave you AN HINT
<nikolar> you did, yea
<zid> ado is the person's concert you mentioned, and usseewa has.. 400 million youtube hits
<nikolar> it is
<nikolar> but not my favourite song so i haven't listened to it enough to remember the lyrics
<nikolar> kek
<zid> the lyrics are niko niko niko lar
<zid> then yo mumble and shout NASHI
<nikolar> kek
[Kalisto] has quit [Quit: No' vemo']
[Kalisto] has joined #osdev
bauen1 has quit [Ping timeout: 276 seconds]
flx has quit [Server closed connection]
fsinger has joined #osdev
kata has joined #osdev
PublicWiFi has quit [Ping timeout: 276 seconds]
netbsduser has joined #osdev
mavhq has quit [Ping timeout: 252 seconds]
mavhq has joined #osdev
PublicWiFi has joined #osdev
da5id has joined #osdev
FreeFull has quit [Ping timeout: 272 seconds]
c0co has joined #osdev
bauen1 has joined #osdev
xenos1984 has quit [Ping timeout: 252 seconds]
xenos1984 has joined #osdev
<pie_> huh. well i suppose.
<pie_> helper thread and the SIGIO helper thread. Running ptrace on this thread usually results in the following picture:"
<pie_> docs.kernel.org/virt/uml/user_mode_linux_howto_v2.html "Tracing UMLWhen running, UML consists of a main kernel thread and a number of helper threads. The ones of interest for tracing are NOT the ones that are already ptraced by UML as a part of its MMU emulation.These are usually the first three threads visible in a ps display. The one with the lowest PID number and using most CPU is usually the kernel thread. The other threads are the disk (ubd) device
<bslsk05> ​docs.kernel.org: UML HowTo — The Linux Kernel documentation
<zid> PICTURE TO FOLLOW. STOP.
<clever> pie_: as a rough guess, i can see how you might use ptrace on the guest userland processes, and rig it up to only halt on attempted syscall
<clever> then the debugging process (the kernel) can do the syscall in userland, and use ptrace to fake the reply
<clever> i dont see why ptrace is needed for mmu emulation, just use ptrace to forcibly call mmap() in each guest
vdamewood has quit [Quit: Life beckons]
xenos1984 has quit [Ping timeout: 252 seconds]
xenos1984 has joined #osdev
<nikolar> clever: I don't know if you've seen earlier but I managed to boot a full distro
<nikolar> And got networking working enough to install packages and even ssh into it
<clever> nikolar: ah, i missed that bit
<nikolar> I should write a writeup or something
<nikolar> It's wonderfully cursed
<zid> nikolar: name it nikolar's guide to bottoms
<nikolar> Kek
<nikolar> Bottoms of what
<zid> no, bottoms
<zid> noun
<nikolar> I get that
<nikolar> But it needs to be a pun
<zid> No it doesn't
<zid> It's already a joke
<nikolar> Like every good tech blog post/write-up
<nikolar> It just has to be
<zid> It's already a joke
<zid> You don't put a pun IN a joke
<heat> nikolar's guide to kernals
<zid> it's not about kernals though
<zid> it's about being a power bottom
<heat> no, i think it's about kernals
<zid> nope
<heat> ok lets agree to disagree
<zid> That's like saying football is about inflation
<nikolar> Lel
<heat> it's not???
<zid> The key aspect is the game, not the technical details of how grass grows
<zid> UML's key aspect is that you'd have to be a total masochist
<bslsk05> ​'How Tottenham Stadium Moves Its Massive 9000 Tonne Pitch | Richard Hammond's Big' by Discovery Australia
<heat> i watch it for the grass
<zid> the spanish ones are better
<zid> It stacks it into a nice pile under the pitch, very cool
<bslsk05> ​'The AMAZING pitch retraction at the new Santiago Bernabéu stadium! | Real Madrid' by Real Madrid
<zid> Gotta put your toys away in case it rains ^
gf3 has joined #osdev
Celelibi has quit [Ping timeout: 252 seconds]
Celelibi has joined #osdev
<pie_> nikolar:
<pie_> <pie_> hm, wonder if this went anywhere https://patchwork.ozlabs.org/project/linux-um/cover/20250430160413.3250227-1-benjamin@sipsolutions.net/ [v2,0/8] SECCOMP based userspace for UML
<pie_> <derRichard> it's upstream, these days uml can use ptrace or seccomp
<pie_> <pie_> oh, so i did tread that somewhere then lol
<bslsk05> ​patchwork.ozlabs.org: [v2,0/8] SECCOMP based userspace for UML - Patchwork
<nikolar> It's cute that someone's still actively working on it
<nikolar> I like it
<klys> heat, the device file /dev/nvme0n1 starts with a bunch of zeroes and is zeroes appreciably throughout as far as I'd checked. yes, no partition table is visible. however I have two nvme drives here, and nvme1n1 should be valid: in /proc/swaps it shows: /dev/nvme1n1\040(deleted) partition 1953514580 77568 -2 The device name reported at fdisk -l is not correct for /dev/nvme0n1 but for /dev/nvme1n1; from
<klys> memory. brw------- 1 root root 259, 0 Aug 7 04:56 /dev/nvme0n1
GeDaMo has quit [Quit: 0wt 0f v0w3ls.]
<klys> so I think my disk is on a different node. does anyone have a /dev/nvme1n1 they could ls -l and give the major/minor numbers to?
<heat> cat /proc/devices
<klys> 242 nvme-generic 243 nvme 259 blkext
criswell has quit [Read error: Connection reset by peer]
<heat> actually
<heat> do you have sysfs?
<heat> if so, ez
<heat> you should be able to manually go through each gendisk (so disk/partition) in /sys/dev/block/
<heat> and fish out the correct one
<klys> ls /sys/block yields: loop0 loop1 loop2 loop3 loop4 loop5 loop6 loop7nvme0n1
<klys> with a space between the 7 and n
<heat> so you don't have an nvme1n1?
<heat> confused.gif
<heat> note that devices start at 0, namespaces start at 1
<nikolar> for some reason
<heat> the reason is quite simple
<heat> nvme specifies that namespace ids start at 1 and 0 is invalid
<heat> they can even be discontiguous
<nikolar> so it's nvme spec's fault
<heat> yeah
<nikolar> is there a particular reason why 0 is invalid
<heat> dunno
<nikolar> is it a sentinel value or sometihng
<heat> maybe they needed an invalid one for the protocol, and between 0 and something like -1 they picked 0
<nikolar> you wrote a nvme driver so that's why i iask
<heat> i wrote two nvme drivers
<nikolar> show off
<heat> :)
<heat> nvme0n2, nvme0n4 is a valid listing for a controller with an inactive namespace 1, active 2, inactive 3, active 4
<geist> daaaaamn heat
<geist> you are an nvme player
<nikolar> he isn't a dvd player though
<nikolar> head i did a cursed
<nikolar> erm, geist i meant
<nikolar> heat already knows
bl4ckb0ne has quit [Server closed connection]
bl4ckb0ne has joined #osdev
<klys> 10, 258 Aug 7 04:54 /dev/nvme-fabrics; 242, 0 Aug 7 04:56 /dev/nvme0; 259, 1 Aug 7 14:13 /dev/nvme0n1; 259, 2 Aug 7 14:16 /dev/nvme0n1p1; 259, 3 Aug 7 14:16 /dev/nvme0n1p2; 259, 4 Aug 7 14:16 /dev/nvme0n1p3; 259, 5 Aug 7 14:16 /dev/nvme0n1p4; 259, 6 Aug 7 14:16 /dev/nvme0n1p5; 259, 7 Aug 7 14:17 /dev/nvme0n1p6; 259, 0 Aug 7 14:14 /dev/nvme1n1
<klys> it all checks out now.
<heat> ah you're doing fabrics
<klys> swaps are reenabled
<heat> geist: i used onyx's nvme driver as a source for the one i wrote for work raisins :P
<heat> (and found a bug in the process, which I'm yet to fix)
<nikolar> why'd you need to write a nvme driver at work
<heat> nvme-over-tcp support for OVMF
<nikolar> fancy
<nikolar> so your code is in ovmf then
<heat> no, not yet
<heat> needs to be further finished and upstreamed
<heat> but the protocol really is quite cool
<nikolar> it's in the pipeline though
<heat> you can vaguely share most of the code between the various NVMe backends if you're smart about things
<nikolar> define vaguely
<heat> vaguely is only vaguely defined :P
<nikolar> kek
<heat> e.g instead of the CC enable bit being toggled manually with some volatile access or something, you can have nvme_write(REG_CC, nvme_read(REG_CC) | EN) with some error checking
<heat> and boom, it ok works for NVMe-over-PCIe, NVMe-over-TCP, NVMe-over-FC
<heat> because it's the exact same startup sequence
<heat> commands are all exactly the same
<heat> the only things that change are the way to setup queues, and the way to submit stuff to those queues
<heat> so what you see in linux is the different backends sharing the core NVMe driver, and in bits where you need high performance (IO submission) they simply use the NVMe core as a bit of a library, without any indirect calls or whatnot
<nikolar> makes sense i guess
<heat> also fun fact linux can act as an nvme PCIe controller
<nikolar> what do you mean
dennisschagt has quit [Server closed connection]
dennisschagt has joined #osdev
<geist> as a pci device node? makes sense probably for some embedded situations
<heat> yeah it can serve as an endpoint
Gooberpatrol66 has quit [Quit: Konversation terminated!]
Gooberpatrol66 has joined #osdev
gf34 has joined #osdev
pie_ is now known as ketchie_
ketchie_ is now known as pie_
gf3 has quit []
gf34 is now known as gf3
<heat> > This driver has been extensively tested using a Radxa Rock5B board
<heat> nikolar: oh hey didn't you have one?
karenw has joined #osdev
bauen1 has quit [Ping timeout: 265 seconds]
<nikolar> i do yea
<nikolar> wait was it 5a
<nikolar> i forgor
<nikolar> what driver, the nvme stuff you were talking about?
<heat> yeah
<heat> ah i think you need an endpoint controller
<nikolar> what for
<heat> for endpointin
runxiyu has quit [Server closed connection]
runxiyu has joined #osdev
<nikolar> of course
frkzoid has quit [Ping timeout: 260 seconds]
criswell has joined #osdev
lanodan has quit [Ping timeout: 252 seconds]
lanodan has joined #osdev
Lucretia has quit [Remote host closed the connection]
monkeyPlus has joined #osdev
jimbzy has quit [Server closed connection]
<pie_> what about controllerin?
<pie_> hi guys im stupid and i dont like it
nyah has quit [Remote host closed the connection]
nyah has joined #osdev
karenw has quit [Ping timeout: 276 seconds]
monkeyPlus has quit [Remote host closed the connection]