Directly entering PM

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.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Directly entering PM

Post by Brendan »

Hi,
mrkaktus wrote:It contains 32bit processor detection, 3 methods of RAM detection (E820, E801, 88), part that loads the Kernel and PM initialisation :). I just put GDT section as a block of mem that is loaded like a kernel from floppy to specified memory adress :)). Now I will work with that A20 gate.
It might be a dumb question, by why limit yourself to 512 bytes?

For example, the boot sector code could start by loading another 3 sectors at 0x7E00, and then you could have a 2 KB boot loader written as a single binary.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
mrkaktus
Member
Member
Posts: 102
Joined: Thu Jan 06, 2005 12:00 am
Location: Poland - Gdansk
Contact:

Re: Directly entering PM

Post by mrkaktus »

Reasons:

- Because I want to show that it is possible.
- Because I don't like RM mode and working with Seg:Off
- I want to be in PM as quick as possible
- I want to have as simple and small code as I can write
(better, smaller code = more of code on disk :D)

I think it is enough of reasons :P
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: Directly entering PM

Post by JAAman »

you don't need to worry about Seg:off much in RMode usually i say -- be compatable, my boot is fully FAT12 complient (unlike GRUB and lilo which only pretend to be)
mrkaktus
Member
Member
Posts: 102
Joined: Thu Jan 06, 2005 12:00 am
Location: Poland - Gdansk
Contact:

Re: Directly entering PM

Post by mrkaktus »

My earlier bootl also supports FAT12 but code that was loaded works in some case weard and I have never discover what was wrong ;/. So I write the new one :).
Da_Maestro
Member
Member
Posts: 144
Joined: Tue Oct 26, 2004 11:00 pm
Location: Australia

Re: Directly entering PM

Post by Da_Maestro »

My OS tests for 386 machines by using 386 instructins:

Code: Select all

xor edx,edx
The principle here is simple, if the OS doesn't even write anything on the screen, then you're not using a 386...If something appears on the screen (Usually saying "Booting AdamOS...") then you have a 386! I figure that 386 compatable processors are so commonplace nowadays that it isn't worth writing heaps of code to test whether the processor is really a 386.
Two things are infinite: The universe and human stupidity. But I'm not quite sure about the universe.
--- Albert Einstein
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: Directly entering PM

Post by JAAman »

doesn't require "heaps" of code its really quite small, but even MS 1.44MB boot sector simply assumes a 386 (and very few earlier CPUs will have a 1.44FDD anyway)

but then your code crashes without explaination on earlier CPUs

if your going to "test" like this then you don't need to test at all -- just use it and the "test" will crash the CPU on the first 32bit override
Post Reply