Page 2 of 2

Re: Directly entering PM

Posted: Sat Oct 29, 2005 11:00 pm
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

Re: Directly entering PM

Posted: Tue Nov 01, 2005 12:00 am
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

Re: Directly entering PM

Posted: Tue Nov 01, 2005 12:00 am
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)

Re: Directly entering PM

Posted: Tue Nov 01, 2005 12:00 am
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 :).

Re: Directly entering PM

Posted: Wed Nov 02, 2005 12:00 am
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.

Re: Directly entering PM

Posted: Wed Nov 02, 2005 12:00 am
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