Page 1 of 1
Porting my 16 bit real mode OS to a 64 bit OS
Posted: Sat Aug 31, 2013 9:45 pm
by michaelk
I have been working on a 16 bit real mode OS for a while now. I would like to be able to make use of all of the hardware resources so I have been researching x86-64 assembly. I don't know where to begin. If any of y'all could recommend some articles or give me some tips that would be greatly appreciated. I am programmed in this in pure x86 NASM Assembly.
Re: Porting my 16 bit real mode OS to a 64 bit OS
Posted: Sat Aug 31, 2013 11:36 pm
by h0bby1
the thing you need to read is the pci bus spec, it's what matter the most, maybe after acpi for up to date hardware , to understand how hardware ressource are configured on modern pc
if you need more info about intel memory model, it's also another story, but i can explain the basics if you need it
the best info you can find about intel related thing are intel manuals, they are avaible for free on their website, but hardware is configured via pci bus, and acpi can worth a look as well, you should be able to find resources you need from google or even this wiki contain lot of information and pointers to articles you might find usefull
Re: Porting my 16 bit real mode OS to a 64 bit OS
Posted: Sun Sep 01, 2013 6:24 am
by thepowersgang
While h0bby1 is correct in fact, it's a little misleading.
@michaelk: If you already know 16-bit RM assembly... then remember to ignore most of that experience when starting on 64-bit, it's a very different architecture
For getting started on it, I'd suggest looking at the architecture overview in the Intel manuals, as well as the articles on the wiki ([wiki]User:Stephanvanschaik/Setting_Up_Long_Mode[/wiki] is pretty good from a quick read)
Re: Porting my 16 bit real mode OS to a 64 bit OS
Posted: Tue Sep 03, 2013 1:40 am
by betatest
michaelk wrote:I have been working on a 16 bit real mode OS for a while now. I would like to be able to make use of all of the hardware resources so I have been researching x86-64 assembly. I don't know where to begin. If any of y'all could recommend some articles or give me some tips that would be greatly appreciated. I am programmed in this in pure x86 NASM Assembly.
first you must get rid of all interrupt references(int 10, int 13, etc...).
next you need to put some direct hardware access stuff where the ints were.
next change all the memory/register references to 64bit.
next add some code in the bootloader(or kernel) to switch to long mode.
finally you compile and if it doesn't work, well... read up to see what needs to be fixed.