QEMU on replit!
h
CSharpIsGud (425)

Ever wanted to make an OS on repl.it but couldn't get an emulator running? Now you can!

Developing, Compiling, Linking an OS is up to you!
Simply fork the repl and do whatever you want with qemu.

You are viewing a single comment. View All
sugarfi (491)

Nice! I have tried a few times to get this to work, but I never could. I can write an OS, now I just have to get one working!

CSharpIsGud (425)

@sugarfi I have an OS with segmentation, keyboard input and vga output, Once I finish up "userland"(I didn't use paging) im going to put it on repl talk.

sugarfi (491)

@CSharpIsGud nice! I started once and got as far as GRUB and paging, then I tried again later and I set up my own 4-stage bootloader that entered protected mode. Then I accidentally deleted all my code.

CSharpIsGud (425)

@sugarfi How did you get paging, by the time I got to that part of the book I was reading I had already done a lot and I couldn't actually identity map anything.

sugarfi (491)

@CSharpIsGud I basically followed a tutorial, with a couple of modifications: https://wiki.osdev.org/Setting_Up_Paging. Once you enable it and set up a table and directory, you just have to use table[vaddr >> 12] = phyaddr to map addresses.

CSharpIsGud (425)

@sugarfi Oh yeah thats essentially what I had, at one point I managed to make it work without faults but the addresses weren't accurately mapped and I couldn't use the framebuffer anymore.

sugarfi (491)

@CSharpIsGud yeah, the mapping goes by pages, not addresses, so it can be inaccurate. I don't know why you couldn't see the framebuffer, though. Did you map the whole lower 1mb?

CSharpIsGud (425)

@sugarfi Pretty sure that part got mapped otherwise it probably would of just exploded

sugarfi (491)

@CSharpIsGud if you try to access unmapped memory, at least in qemu, there is a segfault or triple fault or something and the machine reboots.

CSharpIsGud (425)

@sugarfi My most working solution didn't crash, its just the framebuffer wasn't at the spot I wanted it to be in, just writing a huge chunk of data somewhere would eventually write into the framebuffer at some point