Hello there.
I'm fairly new to OS development, I try to absorb as much knowledge as I can from practical tutorials, NPTEL courses and the wiki.
I have stumbled upon https://wiki.osdev.org/Real_Mode_OS_Warning which is the warning of relying on the BIOS too much.
My question is, how else can I set up the environment in the first steps? because all the tutorials I have seen used BIOS interrupts to check for the A20 gate and get the memory map.
Thank you.
Usage of BIOS
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Usage of BIOS
Be careful. OS development tutorials tend to have bugs in them.sagiv wrote:tutorials
Let the bootloader worry about that. You can write an OS without writing a bootloader.sagiv wrote:My question is, how else can I set up the environment in the first steps?
If you end up writing your own bootloader, then your bootloader will use the BIOS (or UEFI boot services) to set up the initial environment, and the rest of your OS will not use the BIOS (or UEFI boot services).
Re: Usage of BIOS
That won't help you with any current PC, because those typically lack a BIOS (in favor of UEFI), and might not even support A20 mask functionality, because it has been a while since anyone used Turbo Pascal 3 on real hardware.sagiv wrote:My question is, how else can I set up the environment in the first steps? because all the tutorials I have seen used BIOS interrupts to check for the A20 gate and get the memory map.
As Octo said, I would focus on writing a kernel and let it be loaded by a bootloader. If you want the challenge of writing a bootloader, you can do so later, and you can make your bootloader implement the same boot protocol used by your kernel. I actually use a double-wrapped approach, wherein the boot protocol for the actual kernel is bespoke, but I have a UEFI loader and a Multiboot 32-bit loader, and they just copy the information they receive from their respective environments into a unified structure for my kernel to use.
However, the days of the legacy BIOS are over, and no new project should be using it in this day and age.
Carpe diem!
Re: Usage of BIOS
I will want to try my hand at a bootloader, eventually, but I guess for the time being I focus on the OS itself.Octocontrabass wrote:Be careful. OS development tutorials tend to have bugs in them.sagiv wrote:tutorials
Let the bootloader worry about that. You can write an OS without writing a bootloader.sagiv wrote:My question is, how else can I set up the environment in the first steps?
If you end up writing your own bootloader, then your bootloader will use the BIOS (or UEFI boot services) to set up the initial environment, and the rest of your OS will not use the BIOS (or UEFI boot services).
Thanks.
Thank you, I will take it into consideration in my studies and research.nullplan wrote:That won't help you with any current PC, because those typically lack a BIOS (in favor of UEFI), and might not even support A20 mask functionality, because it has been a while since anyone used Turbo Pascal 3 on real hardware.sagiv wrote:My question is, how else can I set up the environment in the first steps? because all the tutorials I have seen used BIOS interrupts to check for the A20 gate and get the memory map.
As Octo said, I would focus on writing a kernel and let it be loaded by a bootloader. If you want the challenge of writing a bootloader, you can do so later, and you can make your bootloader implement the same boot protocol used by your kernel. I actually use a double-wrapped approach, wherein the boot protocol for the actual kernel is bespoke, but I have a UEFI loader and a Multiboot 32-bit loader, and they just copy the information they receive from their respective environments into a unified structure for my kernel to use.
However, the days of the legacy BIOS are over, and no new project should be using it in this day and age.