portable

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Gavin
Posts: 23
Joined: Tue Mar 11, 2008 9:53 pm

portable

Post by Gavin »

If i program my operating system in nasm will it be portable if i use efi firmware? Instead of normal bios.
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: portable

Post by Troy Martin »

Probably not.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: portable

Post by Combuster »

Homework questions:

How does EFI boot your kernel?
How does the legacy bios boot your kernel?
What are the differences?
What are the similarities?
Can you write something that deals with the differences?

Then ask yourself again:
Can I use NASM to solve this problem?


Your posting history suggests that you spend very little effort trying to figure out things for yourself. If you continue this you might get the community against you and not getting your unsolvable questions answered at all.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: portable

Post by Troy Martin »

Another one to look at: does EFI switch to protected mode for you like a GRUB install or not?
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
Gavin
Posts: 23
Joined: Tue Mar 11, 2008 9:53 pm

Re: portable

Post by Gavin »

Homework:

How does EFI boot your kernel?
It uses it's boot manager that is built in to the firmware to execute
the EFI boot loader. Example "\EFI\gavinos\myos.efi and would load my kernel.


How does the legacy bios boot your kernel?
It loads the mbr into ram which in turn loads the boot sector of the active partitions which has a bootloader ie ntldr which then loads the kernel.

What are the differences?
real mode restrictions are gone,
It's stored on firmware so it doesn't need a disk to load a bootloader.It uses it's own bootmanager.
It's a standard so it won't make a difference what operating system is going to be run.

What are the similarities?
Efi uses a bootloader on disk the same as the mbr scheme does to load the kernel.

Can you write something that deals with the differences?
A bootmanager right?

does EFI switch to protected mode for you like a GRUB install or not?
Efi runs in protected mode.

EFI supports boot devices; uses a flat memory model; and hides platform and firmware details from the OS.
Post Reply