OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:09 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Usage of BIOS
PostPosted: Wed Jun 01, 2022 11:25 am 
Offline

Joined: Fri Mar 25, 2022 10:11 am
Posts: 3
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.


Top
 Profile  
 
 Post subject: Re: Usage of BIOS
PostPosted: Wed Jun 01, 2022 9:23 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
sagiv wrote:
tutorials

Be careful. OS development tutorials tend to have bugs in them.

sagiv wrote:
My question is, how else can I set up the environment in the first steps?

Let the bootloader worry about that. You can write an OS without writing a bootloader.

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).


Top
 Profile  
 
 Post subject: Re: Usage of BIOS
PostPosted: Wed Jun 01, 2022 10:17 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1593
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.
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.

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!


Top
 Profile  
 
 Post subject: Re: Usage of BIOS
PostPosted: Thu Jun 02, 2022 12:58 am 
Offline

Joined: Fri Mar 25, 2022 10:11 am
Posts: 3
Octocontrabass wrote:
sagiv wrote:
tutorials

Be careful. OS development tutorials tend to have bugs in them.

sagiv wrote:
My question is, how else can I set up the environment in the first steps?

Let the bootloader worry about that. You can write an OS without writing a bootloader.

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).


I will want to try my hand at a bootloader, eventually, but I guess for the time being I focus on the OS itself.
Thanks.

nullplan wrote:
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.
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.

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.

Thank you, I will take it into consideration in my studies and research.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], DotBot [Bot] and 69 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group