Asking further directions

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
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

Well you got at least one thing wrong: Unreal mode is still 16 bit, and code is therefore also limited to 16-bit based addresses. Hence all code goes below the 1M and must still be 16-bit.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Combuster wrote:Well you got at least one thing wrong: Unreal mode is still 16 bit, and code is therefore also limited to 16-bit based addresses. Hence all code goes below the 1M and must still be 16-bit.
Apologies for that. That was my mistake early on in the thread (I did mention that real mode et al is not my area of expertise... ;) )
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: Asking further directions

Post by jal »

indiocolifa wrote:Also I wonder if GCC can generate suitable executables for non-protected mode 32-bit binaries.
GCC can only produce binaries that use a flat address space, but if you set your segments to 0 and use unreal mode that shouldn't be a problem. I'm not sure though whether GCC can output real mode code.

As for one of your original questions on making a 16 bit real mode OS, there's already one created relatively recently: MikeOS.


JAL
indiocolifa
Member
Member
Posts: 41
Joined: Sat May 24, 2008 12:41 pm
Location: La Plata, Argentina

Post by indiocolifa »

Combuster wrote:Well you got at least one thing wrong: Unreal mode is still 16 bit, and code is therefore also limited to 16-bit based addresses. Hence all code goes below the 1M and must still be 16-bit.
I understood that, I interpret it's related to program execution still pointed by CS:IP and not CS:EIP. So kernel cannot be loaded at > 1MB. Mmm, maybe I can put all data above 1MB, e.g a file system cache, and leave code in the lower 640KBs.

Well, research continues...
indiocolifa
Member
Member
Posts: 41
Joined: Sat May 24, 2008 12:41 pm
Location: La Plata, Argentina

Post by indiocolifa »

After some research I think I'll be better with Protected Mode or 64-bit Long mode. Using unreal mode limits my code to 64KB and you can't even play with that limitation because can't touch the segment registers without returning to plain 16-bit RM.

I've ordered the IA32 Manuals, yesterday arrived (wow!) for free ... Thanks Intel!

Looked at the basic architecture and IA32 System Programming, and seems that 64-bit Long Mode is a more polished environment than the 32-bit P/M. Anyone tried 64-bit development?

thanks.
Post Reply