Porting my 16 bit real mode OS to a 64 bit OS

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
michaelk
Posts: 1
Joined: Sat Aug 31, 2013 9:35 pm

Porting my 16 bit real mode OS to a 64 bit OS

Post 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.
h0bby1
Member
Member
Posts: 240
Joined: Wed Aug 21, 2013 7:08 am

Re: Porting my 16 bit real mode OS to a 64 bit OS

Post 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
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: Porting my 16 bit real mode OS to a 64 bit OS

Post 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)
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
betatest
Posts: 2
Joined: Fri May 03, 2013 12:11 am

Re: Porting my 16 bit real mode OS to a 64 bit OS

Post 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.
Post Reply