Share your repls and programming experiences

← Back to all posts
QEMU on replit!
h
CSharpIsGud (1062)

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.

Comments
hotnewtop
Highwayman (1483)

Now we can make a ReplOS XD

buddy92203 (0)

Thanks! i was looking for something to help me try and install a os in nix

Seven7Four4 (15)

How could I use a disk image with it? I want to use an operating system like Linux, or maybe Ubuntu

mrman314 (0)

I forked and ran the repl, but it shows:

qemu-system-x86_64: error while loading shared libraries: libbrlapi.so.0.6: cannot open shared object file: No such file or directory

I tried it on this repl, and another repl of mine. Any clues?

CSharpIsGud (1062)

@mrman314 I had put the fix on the other ones with it I just forgot to do it with this one. it should work now

mrman314 (0)

@CSharpIsGud Thanks for the quick reply, It works now, Thanks!

[deleted]

Nice! Do you know how to get qemu-system-i386 working on repl? Because the code I made works only on i386.

Here are the fantastic error messages that I get when I try to run it:

qemu-system-i386: error while loading shared libraries: libbrlapi.so.0.6: cannot open shared object file: No such file or directory
exit status 127

Here is the link by the way: https://repl.it/@LucasAllori/theOS

Thanks!

CSharpIsGud (1062)

@LucasAllori Fork the repl this post attached, I uploaded all the things it requires from my own computer.

[deleted]

@CSharpIsGud Thanks! Now I don't have to download the OS and run it on my computer

Coder100 (18178)

Nice work!
Don't know how to use this but I'll learn :)

sugarfi (630)
mov eax, nice
int 69
cli
hlt
nice: db 'Nice'
sugarfi (630)

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 (1062)

@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 (630)

@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 (1062)

@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 (630)

@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 (1062)

@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 (630)

@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 (1062)

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

sugarfi (630)

@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 (1062)

@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

LiamDonohue (294)

how do you load a os into it?

CSharpIsGud (1062)

@LiamDonohue Assuming you have one just run qemu like you normally would like qemu-system-x86_64 IMAGE.iso or qemu-system-x86_64 -kernel KERNELIMAGE

RobertFurr (64)

why did you turn the first 2 lines into comments

CSharpIsGud (1062)

@RobertFurr The first line wasn't supposed to be a comment, I fixed that. I need to find some way to keep it from reinstalling qemu every time if its already installed and I was testing it.
the second line is actually a comment, you can put whatever there like commands to compile a kernel

RobertFurr (64)

@CSharpIsGud okay. Can you put a comment with an example as to what someone should do so they don't have to figure it out yourself?

CSharpIsGud (1062)

@RobertFurr I thought of adding an example OS, but the point of the post is to show qemu working on repl.it not developing an OS.

CodeSalvageON (604)

Didn’t work but still it’s very cool