Search logs:

channel logs for 2004 - 2010 are archived at http://tunes.org/~nef/logs/old/ ·· can't be searched

#osdev2 = #osdev @ Libera from 23may2021 to present

#osdev @ OPN/FreeNode from 3apr2001 to 23may2021

all other channels are on OPN/FreeNode from 2004 to present


http://bespin.org/~qz/search/?view=1&c=osdev2&y=21&m=10&d=25

Monday, 25 October 2021

04:13:00 <klange> Finished up and merged my bootloader branch to do mode setting, since someone on Discord (no I don't have a Discord server, just someone in a mutual server) said they had managed to partially boot from a USB stick with my loader, but VGA text mode wasn't working (not sure what's up with that, the boot log works, but the userspace terminal emulator doesn't) and obviously no framebuffer...
06:47:00 <vai> hi all morning
06:51:00 * Mutabah waves
07:05:00 <Oli> Hello, and good day!
08:10:00 <klange> Oh good, DigitalOcean's CDN supports clear-text HTTP... their direct "Spaces" product does not, but the CDN in front of it does, so I can use it as a package repository.
12:05:00 <opios2> does bochs support nested virtualization?
12:09:00 <klange> You're going to need to clarify what you mean.
12:11:00 <klange> Bochs itself is not virtualized at all. If you mean does it implement the VM extensions such that an OS running within it can expose nested virtualization (which would but your _four_ levels deep, three of which are Bochs), I believe so, but it'll probably take you three years just to boot the second nesting.
12:18:00 <zid> bochs is an emulator
12:26:00 <Mutabah> Bochs is a pure simulator, it does not use/require the host to have virtualisation extensions
12:32:00 <opios2> yeah i know its an emulator that support virtualization like you can run a hypervisor inside it
12:32:00 <zid> you can run a hypervisor in any program
12:32:00 <opios2> so now can my hypervisor inside bochs can run another hypervisor?
12:32:00 <zid> if your hypervisor itself decides to set up another one, there's no reason why not
12:33:00 <opios2> ok
12:35:00 <zid> bochs will have to support translating your hypervisor instructions setup into something the host OS understands though
12:36:00 <zid> and idk offhand that it actually does
12:37:00 <klange> Bochs even supports SVM, which QEMU regularly informs me my actual CPU does not support...
12:38:00 <zid> It's okay, your cpu feels shameful
12:38:00 <klange> Nah, just old.
12:38:00 <zid> It just so happens to be a sadist so it's fine
12:40:00 <josuah> a "aha!" moment for me (noob) was when Xen could run a VM on hardware that did not support virtualization
12:41:00 <j`ey> how?
12:41:00 <klange> Before virtualization extensions like VT-x, there were all sorts of dirty tricks things like VMware used.
12:42:00 <klange> Xen is essentially its own platform target because of how it does its thing...
12:43:00 <zid> Run it as a user mode program, catch all the illegal instruction faults, simulate them? :P
12:43:00 <zid> like vmexit but ghettoier
12:46:00 <josuah> j`ey: it requires the host operating system to be aware it is a VM, and rather than use hardware interfaces, use interfaces provided by Xen (the hypervisor)
12:46:00 <j`ey> oh right, paavirt
12:46:00 <j`ey> paravirt
13:18:00 <vin> What are some interesting small concurrnecy projects/assignments you have come across? That requires good use of locks or conditional variables. How can I say if a program uses multiple threads to solve a problem without reading it's code?
13:18:00 <vin> I am designing this problem from an OS learning perspective
13:19:00 <klange> If you run it with `time` and it takes notably more `user` time than `real` time, it probably uses threads ;)
13:19:00 <zid> if it uses more than 1/cores% cpu use
13:20:00 <zid> as a single process
13:20:00 <vin> Can I do that deterministically though? I was thinking of just doing a ps and checking how many threads are spawned but there is no gurantee those threads are doing the work.
13:21:00 <klange> That sounds like it may be a variant of the halting problem. Read the code if you want to know if it uses threads to do useful things.
13:21:00 <zid> or check the imports/syscalls it does
13:21:00 <zid> to see if it at least 'uses' threads
13:22:00 <klange> Speaking of `time`, I need to fix my shell built-in... it acts more like the `time` command but i should be able to make it work like the shell prefix...
13:23:00 <vin> Yea a combination of time and ps should be okay.
13:24:00 <vin> What is a simple OS tool that benefits greatly from threads?
13:24:00 <zid> nothing
13:24:00 <zid> threads are just an option
13:24:00 <klange> (and if you're wondering wtf I'm going on about, compare `time echo foo | sleep 2` with `/usr/bin/time echo foo | sleep 2` in Bash)
13:24:00 <vin> speed is always a benefit zid
13:24:00 <junon> vin: message passing is one thing that comes to mind.
13:24:00 <junon> but not required.
13:24:00 <junon> benefits greatly, but not required.
13:24:00 <zid> threads are not faster
13:25:00 <vin> zid: using more cores is
13:25:00 <zid> more processes also does that
13:25:00 <junon> assuming a process is allowed to touch all resources that the kernel can touch, sure
13:25:00 <vin> junon: yes
13:25:00 <zid> threads are just an abstraction to pretend multiple processes exist from a single one, you can also just do that by starting more processes
13:26:00 <junon> if so, then zid is of course correct
13:26:00 <vin> Right, threads are sort of processes in linux anyway. Just that they share address space so allows more control on how they communicate with each other.
13:26:00 <zid> It's a *convenient* abstraction, and makes *writing* some things simpler in some cases
13:27:00 <Jerjerbinks> hi
13:27:00 <junon> e.g. io_uring uses a dedicated kernel thread in SQPOLL mode where you can invoke kernel subroutines from userspace by submitting them to a shared memory region (between the process and the kernel). Though in practice it's not as fast as you'd think unless you're setting boot-time kernel thread affinity.
13:27:00 <junon> vin: Think of processes as a collection of 1 or more threads. Address space (usually) belongs to the entire process, not an individual thread.
13:27:00 <junon> They're just conceptual abstractions.
13:28:00 <vin> Yup
13:28:00 <junon> The CPU only cares about "tasks". However you want to employ them is up to you.
13:28:00 <zid> cpu doesn't even care about tasks
13:28:00 <junon> Just referring to task selector, etc.
13:28:00 <zid> it just knows ring0 and ring3 or whatever
13:28:00 <junon> TSS
13:28:00 <zid> yea nobody uses tss :p
13:29:00 <zid> you use it to grab a valid stack pointer for IRQs and that's it, it might as well be an MSR
13:29:00 <junon> maybe I use TSS zid, don't erase me
13:29:00 <junon> :D
13:30:00 <vin> can multiple threads use same io_uring buffer junon ?
13:30:00 <junon> I knew the answer at one point. My knee-jerk reaction would be to say no.
13:30:00 <Jerjerbinks> Anyone used uIP TCP/IP stack? actually know it?
13:31:00 <junon> I'd probably create a queue per-thread vin
13:32:00 <junon> Plus in high throughput you're not waiting between iterations anyway, you're spinning as fast as possible, which means you probably don't want to slam the CPU's cache waiting for memory barriers to resolve since you 'lease' out request entries.
13:33:00 <junon> Plus you need to submit in order for the best performance, I don't even know if you can submit out of order.
13:33:00 <junon> Which means the threads would have to coordinate that too, which means some sort of lock, which defeats the entire purpose.
13:34:00 <vin> I see
13:36:00 <junon> But that's faster in theory anyway since the kernel doesn't need to use locks to read from multiple queues. It just has to do for-each-queue, for-each-pending-request-in-said-queue. Not a whole lot of logic there.
13:36:00 <junon> It's pretty directly a memory-vs-performance tradeoff, and the memory is, usually, negligible.
13:36:00 <junon> And fixed, for that matter.
13:39:00 <junon> The reason why SQPOLL exists, which spawns a kernel thread, is to handle reading, parsing, and dispatching those queues, usually on a dedicated core affined only for the SQPOLL thread. But you have to specify that in the boot parameters. It's typical to affine the main kernel thread to 0, an SQPOLL thread to 1, and then you affine your application threads to the rest of the cores.
13:39:00 <junon> (note that there's very little evidence this actually improves performance in production as io_uring is so new, but of course this sounds like it would on paper)
15:57:00 <nur> is anyone attending SOSP 2021 right now
17:35:00 <Kerum> are there any tools which can update the MBR of a disk and the VBR of a FAT12 partition without touching the partition table or the BPB respectively?
17:45:00 <zid> hex editor? :P
17:45:00 <zid> If I needed a simple disk util like that in my project I'd probably just write it and stick it in util/ in my source tree
17:46:00 <zid> and set make to build it before using it to prep the disk image
17:46:00 <gog> you can use dd if you're careful
17:46:00 <gog> write only the first 446 bytes then the n bytes of wherever the VBR is
17:55:00 <Kerum> zid: i will consider that, thanks
17:56:00 <Kerum> gog: i am aware that dd exists, i would just prefer to be able to update both MBR and VBR with 1 command and not have to instruct it to only write 446 bytes or to skip the BPB every time
17:56:00 <Kerum> thanks anyway for the suggestion
17:56:00 <Kerum> granted i could write a simple shell script or even an alias
17:59:00 <gog> script is best, less opportuntity to punch in the wrong numbers
18:00:00 <zid> build your disk image using ld ;)
18:01:00 <Kerum> ld the linker?
18:01:00 <zid> Yea I build all sorts of things I shouldn't using linker scripts
18:02:00 <zid> I'm the proud owner of a custom 3D model format I made using gcc and ld..
18:02:00 <Kerum> sounds interesting
18:02:00 <zid> yes, I have corrupted another!
18:04:00 <Kerum> anyway, i just made a minimal MBR+VBR setup
18:04:00 <Kerum> MBR sets up stack, looks for active partition, loads its VBR and executes it
18:05:00 <Kerum> only now did i find out that a floppy disk does not even have an MBR
18:05:00 <clever> which is why a usb stick without an MBR is often called s super-floppy
18:06:00 <Kerum> so on a storage device with an MBR this will cause no issue
18:06:00 <Kerum> but should i still move the stack setup to the VBR because of MBR less storage?
18:07:00 <Kerum> or just initialize stack in both
18:07:00 <clever> maybe initialize it in both?
18:07:00 <Kerum> yeah, will probably do
18:07:00 <clever> your never going to `return;` back to the MBR once in the VBR
20:06:00 <kazinsal> "Welcome to GitHub Copilot Technical Preview!" oh no
22:00:00 <geist> now we can never trust anything you do
22:40:00 <klange> looking forward to seeing the OS Copilot cobbles together
23:14:00 <zid> I hope they copilot my linker scripts
23:14:00 <zid> I do hope geist was replying to me
23:28:00 <geist> isn't the copilot thing where it AI generates stuff for you?
23:29:00 <kazinsal> yeah
23:29:00 <kazinsal> aka a GPU rips off GPLed code
23:30:00 <geist> so how does that work outside of the web page? is it a plugin for vscode or something that talks to github servers?
23:31:00 <kazinsal> yeah, the email has a link to a vscode extension
23:31:00 <kazinsal> https://marketplace.visualstudio.com/items?itemName=GitHub.copilot
23:31:00 <bslsk05> ​marketplace.visualstudio.com: GitHub Copilot - Visual Studio Marketplace
23:31:00 <geist> ah okay
23:31:00 <kazinsal> I didn't even sign up for it, they just randomly added me to the whitelist
23:33:00 <geist> gues it would be interesting to use it for some osdev hackery
23:33:00 <geist> see if it blats out a bootloader for you or gets you into protected mode
23:33:00 <klange> I've been waiting for someone to try just to see what it produces.
23:33:00 <klange> And what it pulls from...
23:34:00 <klange> So now that my BIOS loader does modesetting, the text thing I built for the EFI one just feels boring. What should I do with this? https://klange.dev/s/Screenshot%20from%202021-10-26%2008-33-38.png
23:35:00 <klange> I was thinking maybe a background, possibly some borders so it looks like a terminal window?
23:36:00 <geist> probably will just copy a bunch of bad ideas from the jamesm tutorial
23:37:00 * kazinsal begins chanting in latin at the mention of that name
23:38:00 * gog puts out the pentrgram and candles
23:38:00 * klange plays Quake
23:42:00 <klange> I added support in my compositor for 24bpp framebuffers, finally. Still doing 32bpp everywhere else, but special cased the final flip to the framebuffer memory to do the... I was going to say swizzle, but that's not quite right.
23:42:00 <klange> Though speaking of swizzles, is it worth my time to further support other pixel formats...
23:42:00 <geist> hmm, do you have something handy that does 24bpp?
23:43:00 <klange> The Cirrus card QEMU emulates does 24bpp.
23:43:00 <geist> ah
23:43:00 <klange> Feels hella wrong to put `-M q35` and `-vga cirrus` in the same command line, but, it works :)
23:43:00 <klange> https://klange.dev/s/Screenshot%20from%202021-10-26%2008-43-45.png