flat assembler
Message board for the users of flat assembler.

Index > OS Construction > "I don't mind using the BIOS ..."

Thread Post new topic Reply to topic
Mike Gonta

Joined: 26 Dec 2010
Posts: 238
Location: the-ideom
Mike Gonta
in private conversation wrote:
I don't mind using the BIOS as it's included with every computer already.
Most beginners to OS development choose real mode programming to have the convenience of the BIOS functions.
The low level device drivers are only a small part of OS development and in some cases prove to be a stumbling
block for some. Using the BIOS is an easy way to get up and running quickly. Historically entire operating systems
were based on the BIOS (DOS for example).
The only problem with real mode is that it's real mode. Today we have 64 bit long mode. 32 bit protected mode is
still a viable system.
So where does that leave those using real mode? Behind!
What if the computer were to load a user supplied 32 bit protected mode boot sector to 7C00h and run with the
Protected Mode Interrupt Descriptor Table loaded and interrupts enabled and handled, the A20 gate enabled and
access to the complete 4GB address space available only limited by the actual physical memory installed?
What if this 32 bit protected mode boot sector and the kernel that it loads to high memory had access to the
standard native motherboard BIOS functions while in 32 bit protected mode?
aeBIOS is loaded through the standard booting process. aeBIOS quickly sets up and enables 32 bit protected mode
and then loads a user supplied PM32 boot sector which begins the classic Operating System process only in PM32.
The current distribution of aeBIOS is a FAT12 floppy disk image designed to boot and run from a USB flash drive.
A simple PM32 boot sector/boot loader is included (which can be easily modified or changed). Simply write your OS
kernel in PM32 with an ORG of 1MB, copy it to the root directory of the flash drive, boot and run. Qemu can be used
to emulate the boot and run of the actual flash drive or a virtual floppy disk can be used.
Working in PM32 makes it a lot easier to develop and test PM32 code. It's simple to hook the PM32 interrupt
descriptors to develop device drivers. Using the standard well known BIOS interface would facilitate code sharing.
Most people today do not consider the boot loader nor the process of setting up protected mode to be a part of
OS development (it's just a necessary evil which many a beginner has not gotten far beyond). For example many
use the excellent boot loader GRUB which takes care of these details, the only problem is that you
can't get there from here, in other words now that you are in PM32 what will you do.
aeBIOS is not a boot loader, it's simply a 32 bit protected mode environment with standard BIOS access.
The 32 bit protected mode FAT12 system provides a simple modern startup for the beginner.
Currently I'm working on FAT32 support and have future plans for 64 bit.

Mike Gonta
the-ideom - now you know how to compile


Last edited by Mike Gonta on 08 Feb 2012, 23:48; edited 1 time in total
Post 09 Jun 2011, 20:14
View user's profile Send private message Visit poster's website Reply with quote

Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
good article.

But I still have trouble trying to load my kernel from a medium. In my simple OS project, I had to copy the kernel code byte by byte to 8000H and then jump to it. I thought that was an easier way. But in order to load a whole basic kernel (which would not fit in a floppy with the loader) I'd have to read the disk anyways (that is what I was trying to get away from ).

Thanks for the info though.
Post 09 Jun 2011, 23:22
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.