How to boot a unreal mode kernel?

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
Silenger

How to boot a unreal mode kernel?

Post by Silenger »

If you use a normal real mode boot loader can the code he loads be 32bits or has it to be 16bits?

Or do you need a pm boot loader en then let him load the 32bit code then switch to unreal mode? ???
PlayOS

Re:How to boot a unreal mode kernel?

Post by PlayOS »

You can load any kind of code you want, as long as you only execute 16 bit code when in real mode. If you load 32 bit code then you will need to be in full 32 bit Protected Mode to execute it, because in real mode (and unreal mode) the processor only uses IP and 32 bit code needs EIP.

Hope this helps.
Silenger

Re:How to boot a unreal mode kernel?

Post by Silenger »

Thx

I used Free Pascal 2 output nams code then build it with nasm to a bin file.

So it wil be 32bit code what means it wil hang on real mode :'(

So i have to use a 16bit compiler that outputs nasm code. Then it should work?
PlayOS

Re:How to boot a unreal mode kernel?

Post by PlayOS »

You should probably learn how to write your boot loader yourself in asm, you will learn alot about the boot process and you will be able to write better code than the compiler.

There are many boot loaders that you can learn from on this forum, I also have a little example boot loader and kernel that you can use in any way you want. If you want it you can get it here http://home.kooee.com.au/tim_danielle/o ... kernel.zip.

It isn't very well commented but you should be able to catch on.

However if you are content to write it in a high level language then go for it, you will have to be careful when it comes to low level memory structures and registers like the GDTR, IDTR and stuff like that, so I would recommend that you learn a little asm (if you dont already know that is ;)) and write your boot loader in that.

Anyway, Good Luck!
Silenger

Re:How to boot a unreal mode kernel?

Post by Silenger »

k thx i will try pmode because i want to use pascal and asm code :)
Tom

Re:How to boot a unreal mode kernel?

Post by Tom »

Hmmm....why make your OS in pascal?

Any special need? It seems that C/C++ is more widly used...and more you can use more code/people can more of you OS's code.
Post Reply