How do you develop an operating system with VirtualBox?
How do you develop an operating system with VirtualBox?
How do you develop an operating system with VirtualBox?
Without GRUB and all that stuff. Basically execute the basic example at https://wiki.osdev.org/Babystep1.
Without GRUB and all that stuff. Basically execute the basic example at https://wiki.osdev.org/Babystep1.
Re: How do you develop an operating system with VirtualBox?
first i use a floppy image whit basic functionality installed to test the kernel on a very simple VM, like your exemple but improved https://github.com/N-LG/SEAC/blob/master/disquette.ASM
and finaly i upgrade (over the network with a tftp server) an other VM who have an old version of my kernel to test full functionality
and finaly i upgrade (over the network with a tftp server) an other VM who have an old version of my kernel to test full functionality
-
- Member
- Posts: 5885
- Joined: Mon Mar 25, 2013 7:01 pm
Re: How do you develop an operating system with VirtualBox?
Instead of attaching the floppy disk image to the emulated floppy disk drive in QEMU, attach the floppy disk image to the emulated floppy disk drive in VirtualBox.
That example you're following is more of a bootloader than an operating system. Are you sure you want to write a bootloader? It's a lot of work, and that means less time to write your operating system.
That example you're following is more of a bootloader than an operating system. Are you sure you want to write a bootloader? It's a lot of work, and that means less time to write your operating system.
Re: How do you develop an operating system with VirtualBox?
I am getting this error:
These are the exact steps I followed:
1. Copied and pasted the bootloader into a kernel.asm file:
2. Compiled the bootloader with nasm:
3. Added a floppy controller in VirtualBox
4. Selected the floppy drive selecting kernel.bin

Code: Select all
Failed to open the disk image file C:\Users\Adrian\Desktop\kernel.bin.
Could not get the storage format of the medium 'C:\Users\Adrian\Desktop\kernel.bin' (VERR_NOT_SUPPORTED).
Result Code: VBOX_E_IPRT_ERROR (0x80BB0005)
Component: MediumWrap
Interface: IMedium {ad47ad09-787b-44ab-b343-a082a3f2dfb1}
Callee: IVirtualBox {d0a0163f-e254-4e5b-a1f2-011cf991c38d}
Callee RC: VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)
1. Copied and pasted the bootloader into a kernel.asm file:
Code: Select all
cli
hang:
jmp hang
times 510-($-$$) db 0
db 0x55
db 0xAA
Code: Select all
nasm kernel.asm -f bin -o kernel.bin
4. Selected the floppy drive selecting kernel.bin
Re: How do you develop an operating system with VirtualBox?
i think virtualbox want a floppy image of 1474560 byte
so try to add "times 1474048 db 0" to your code
so try to add "times 1474048 db 0" to your code
Re: How do you develop an operating system with VirtualBox?
I don't know where you got this number from, but it doesn't work anyways. The same thing keeps happening.nlg wrote:i think virtualbox want a floppy image of 1474560 byte
so try to add "times 1474048 db 0" to your code
-
- Member
- Posts: 5885
- Joined: Mon Mar 25, 2013 7:01 pm
Re: How do you develop an operating system with VirtualBox?
VirtualBox does not recognize the file extension. Try changing the file extension to "img", "ima", "dsk", "flp", or "vfd" for your floppy disk image.
Re: How do you develop an operating system with VirtualBox?
I highly recommend building ISOs, possibly with GRUB's mkrescue tool, for testing across a wide variety of emulators with ease. VirtualBox will have no trouble with that.
Re: How do you develop an operating system with VirtualBox?
It is almost 2021 and people still ask questions about floppy images. WTF?
Just use an ISO or make a virtual HDD (that I what I do for my OS).
Just use an ISO or make a virtual HDD (that I what I do for my OS).
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
Re: How do you develop an operating system with VirtualBox?
I think klange and Octacone is right. I'm asking the moderators and old members: what do you think, is it time to remove floppy instructions from the wiki? Or at least move all of it to an "outdated" category? I guess the wiki should talk about LBA addressing and have USB-compatible boot tutorials. Opinions?
Cheers,
bzt
Cheers,
bzt
Re: How do you develop an operating system with VirtualBox?
I don't think any article should ever be removed for being about an outdated tech, but there's definitely an argument to be made about steering people away from targeting such outmoded things.bzt wrote:I think klange and Octacone is right. I'm asking the moderators and old members: what do you think, is it time to remove floppy instructions from the wiki? Or at least move all of it to an "outdated" category? I guess the wiki should talk about LBA addressing and have USB-compatible boot tutorials. Opinions?
Re: How do you develop an operating system with VirtualBox?
I agree, "outdated" category is better.klange wrote:I don't think any article should ever be removed for being about an outdated tech, but there's definitely an argument to be made about steering people away from targeting such outmoded things.
I've checked the wiki, and the thing is, there's not much floppy-related stuff actually.
Bootloader in section Loading your kernel could mention BIOS LBA packets, but that's all.
Rolling your own bootloader mentions hard drive, it might use an example code though.
Boot sequence has a section on hard disks and MBR.
File systems talks about floppies, but about disks as well.
Disk images talks about floppies, but also about hard disks.
Loopback device likewise, there's an entire section on hard disk images too.
Bare bones tutorials use GRUB Multiboot.
Real mode assembly series does not load sectors at all.
Babystep1 does mention floppy, but there's nothing in the code that shouldn't work on HDD. Maybe a "qemu -hda" example would be useful.
Did I miss something? It looks like our wiki does not suggest floppies (except for GRUB mkrescue which indeed requires a floppy image so that's fine).
Cheers,
bzt
Re: How do you develop an operating system with VirtualBox?
This solved my problem, thanks.Octocontrabass wrote:VirtualBox does not recognize the file extension. Try changing the file extension to "img", "ima", "dsk", "flp", or "vfd" for your floppy disk image.
Like most people here, I am not developing an OS for need, but for fun and because I want to understand how computers work. I do know that OS developing would be much easier using GRUB instead of floppy images, but with floppy images you can develop your own boot sector whereas in the other hand with GRUB you don't have control over it since you have the job done for yourself. This way I can understand much better how things work (and why is it such a bad idea to develop a bootsector yourself instead of relying on GRUBOctacone wrote:It is almost 2021 and people still ask questions about floppy images. WTF?
Just use an ISO or make a virtual HDD (that I what I do for my OS).

Re: How do you develop an operating system with VirtualBox?
I also agree. I thoroughly enjoyed programming the FDC, using quirks to find the different types of FDCs available. Yes, the FDC is outdated, but I believe it is a great learning experience to program the FDC. Learn how to communicate with the hardware, learn the different quirks, learn how to use polling or DMA, all in all, a great learning experience.bzt wrote:I agree, "outdated" category is better.
Probably will never use it again, nor ever need to. However, it was an enjoyable thing to do and a good learning experience, not only to learn about the FDC but to help with my hardware programming experience. I would recommend it to anyone.
My opinion would be the same as already said, do not remove outdated information, but do encourage those wanting to target newer hardware to not worry about this outdated information.
Ben
Re: How do you develop an operating system with VirtualBox?
@BenLunt: thanks for sharing your opinion! I'm glad we all agree.

Cheers,
bzt
Actually, you can also develop your boot sector for disks too. The only difference is, you'll have to use a different BIOS routine to read the disk (int 13h, ah=0x42, using LBA packets, you can forget about CHS addressing), but that's it. You can find many examples on the wiki, BootProg, Gujin, BOOTBOOT's stage1, etc. Neither of these use GRUBslammar wrote:with floppy images you can develop your own boot sector whereas in the other hand with GRUB you don't

Cheers,
bzt