Page 1 of 1
Crypticalcode0's OS project.
Posted: Sun Dec 04, 2011 2:43 am
by CrypticalCode0
I have a idea for a barebone Micro kernel, although a nano kernel can also be a right word for it.
My design goals are.
For the kernel
[*] Minimalistic kernel, nearly everything gets done in user space.
[*] No MMU support, this is because the systems i want it to work on usualy lack this feature.
[*] Running on both the Z80 and 6502. (in theory Z80 code should be runable on a x86)
[*] ondemand loading of AOS style libs. (likely not api compatible)
Most of the code should be PIC.
If anyone has questions on my OS or why i made my choices i am willing to explain when i have the time for it.
And good advice is always welcome.
Oh and i need a name for it.
Re: Crypticalcode0's OS project.
Posted: Sun Dec 04, 2011 4:02 pm
by DavidCooper
CrypticalCode0 wrote:in theory Z80 code should be runable on a x86
How does that work? I may have missed something in the x86 processor manuals as I haven't read every part of them, but I've never noticed any way of switching into a mode that uses the Z80 instruction set.
Oh and i need a name for it.
If you aren't good at thinking up names yourself, homo erectOS would be a good name for a primitive OS, and it would help you to get it noticed.
Re: Crypticalcode0's OS project.
Posted: Sun Dec 04, 2011 4:27 pm
by CrypticalCode0
the Z80 has the same instruction set as a intel 8080 on which the 8088 and 8086 were based there are a few differences which are prohibbiting source compatibility with eachother, but in reality they are bineary compatible with each other, and that is what makes it worth while in my humble opinion.
this compatibility is however single sided and with this i mean the Z80 can run 8080 binearies but the 8080 cannot run z80 binearies when some features are used.
I intend to write most code in C anyhow.
Re: Crypticalcode0's OS project.
Posted: Sun Dec 04, 2011 4:43 pm
by DavidCooper
CrypticalCode0 wrote:the Z80 has the same instruction set as a intel 8080 on which the 8088 and 8086 were based there are a few differences which are prohibbiting source compatibility with eachother, but in reality they are bineary compatible with each other, and that is what makes it worth while in my humble opinion.
this compatibility is however single sided and with this i mean the Z80 can run 8080 binearies but the 8080 cannot run z80 binearies when some features are used.
I intend to write most code in C anyhow.
I've written operating systems for the ZX Spectrum+3 and Amstrad PCWs (Z80 machines), and for the PC (which is obviously x86), all written directly in machine code, so I have a fair idea about the form of the instructions. In the course of doing that work, I didn't notice any possibility that they were in any way compatible. I suspect the point where you're making an error is in believing that 8080 and 8086 are compatible - the latter no doubt borrows a lot of ideas from the former, but the instruction set is not one of them.
Re: Crypticalcode0's OS project.
Posted: Sun Dec 04, 2011 4:59 pm
by DavidCooper
I've heard this kind of confusion before, and after looking at
http://en.wikipedia.org/wiki/Intel_8080 I think I know why:-
At Intel, the 8080 was followed by the compatible and electrically more elegant 8085, and later by the assembly language compatible 16-bit 8086 and then the 8/16-bit 8088, which was selected by IBM for its new PC to be launched in 1981.
It would be easy to think that "assembly language compatible" means that the underlying instructions are identical, but they are radically different. It does suggest though that you can use the same source code and assemble it for different processors, so long as it doesn't need to access anything outside of a 64K block.
Edit: here's a quote from further down the same page:-
The 8080 and 8085 gave rise to the 8086 which was designed as a source compatible (not binary compatible) extension of the 8085.
So, you were actually right in your original post: there's a compatibility between 8080 and 8086 which I wasn't aware of because it doesn't show up at the machine code level, and the fact that the binary isn't compatible may not be a problem for you at all.
Further edit (the next day): I can't see a lot of point though in using 8080 assembly for any part of your OS - the assembly compatibility might conceivably be useful for porting a few complex 8080 progams if they're still of some value to someone, but it certainly isn't going to do anything useful in designing your OS.
Re: Crypticalcode0's OS project.
Posted: Sun Dec 04, 2011 5:45 pm
by CrypticalCode0
David your correct i should have been a little more specific with my choice of words.
Re: Crypticalcode0's OS project.
Posted: Sun Dec 04, 2011 5:50 pm
by DavidCooper
You've helped solved an old mystery for me today, so thanks, and good luck with your project.
Re: Crypticalcode0's OS project.
Posted: Wed Dec 07, 2011 2:08 am
by CrypticalCode0
Okay to clear up all the air in here the Z80 is binary compatible with the Intel 8080, the intel 8080 is to some point source compatible with the 8086.
This by no means makes the Z80 directly compatible with the x86 architecture.