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.
WARNING : this could be rubbish as its a thought based on NO knowledge!
Surely that doesn't matter as if you get GCC to produce the different parts in modules of position independant code then the code won't need to worry about what the various segments are. You would just have to have some base code (possibly in ASM) which linked them altogether and controled the segments etc.
The problem is that your code ends up in .text (pointed to by CS), your variable initializations in .data (pointed to by DS), and your stack in the stack segment (pointed to by SS).
Then there's ES, FS, and GS, and you could put them to quite some tricky use.
But GCC expects a "flat" memory modell, assumes that ES is the same as DS, considers FS to be some untouchable magic value for compatibility with OS/2 / NT... there are some very limited things you can do with segments and GCC, but usually you just set CS, DS, and SS to 4 GByte starting at 0, and forget about segments...
Every good solution is obvious once you've found it.
Brendan wrote:
To me the crappy-ness of 80x86 is one of the attractions - to be doing one of the most complex projects (OS), on one of the worst architectures (IA-PC), in one of the hardest languages (Intel/80x86 assembly).
I'm not sure I'd say that x86 is the hardest architecture out there... I've heard some nasty things about programming for older MIPS processors. Specifically, that these processors lack pipeline interlocks, so if you don't explicitly put the right number of nops in very specific parts of your code, you're screwed.
It's tricky to identify the level at which to do the abstraction. But that level certainly isn't anywhere within the kernel. There might be modules you can carry from one CPU to the other - the scheduling algorithm for example - but most of the kernel doesn't really cater to HAL'ing.
The truth of that statement depends a lot on whether you're implementing a microkernel. The more of a kernel there is to port, the more of it will be portable (i.e. -- the architecture-specific parts are a fixed overhead).
Top three reasons why my OS project died:
Too much overtime at work
Got married
My brain got stuck in an infinite loop while trying to design the memory manager
srg wrote:Trouble is that segmented os aren't portable, which is one of my goals.
Alas, this guarentees the same thing portability always does: you must always code for the lowest common denominator. A portable OS is thus guarenteed to be an inferior OS, at least to what it could have been...
srg wrote:Trouble is that segmented os aren't portable, which is one of my goals.
Alas, this guarentees the same thing portability always does: you must always code for the lowest common denominator. A portable OS is thus guarenteed to be an inferior OS, at least to what it could have been...
I'm not in it to make the worlds most innovative and best os, I just want to make an os, if you get what I mean. Anyway, once I've made one, then surely in the future if I want to create a better one, I'll have the background knowledge rather than stumbling arround (walk before you can run).
Also, I want to keep things simple, and not get too clever (an innovative os that crashes every five mins is nothing compaired to a boring os that goes and goes and goes.
I feel getting my kernel to a point that allows me to say, "Hey. I got it working.". I have been trying to build a working kernel for quite a few years now, only to get it mostly completed then become sidetracked and quit working on it for numerous months at a time unfortunately.
I got to thinking a few weeks ago what this point would be. I have come to the conclusion that being able to write some of my own scientific experimentation simulations on this small plain operating system would be enough success to consider it a job well done.
The reason i started writing my OS, is because one day about 4 years ago my senior year of highschool, i was sitting in my room and thought to myself "I wonder how you write an operating system".
And then i started googling "how to write an OS".
hahahaha.
4 years later, I'm still working on it going strong. I didn't think it would last this long, or get as far along as it is. But its so damn addicting. You get one part done, and then you can see how that part will enable another cool part to work. So you start working on that.
So i would say my drive is everything that i've been learning. And the satisfaction of what i have been able to do so far. My OS is doing nothing new or revolutionary. Its just doing the same stuff thats been done many times before it. But its a lot of fun. It would be cool if even a small community formed around my OS. But i dont really count on it. In the future possibly i'll have the knowledge to go about designing things in a better more efficient manner. but for now simplicity and making it work in general is what i'm striving for.
omin0us wrote:I suppose I'll also add on to this old post. :]
The reason i started writing my OS, is because one day about 4 years ago my senior year of highschool, i was sitting in my room and thought to myself "I wonder how you write an operating system".
And then i started googling "how to write an OS".
hahahaha.
4 years later, I'm still working on it going strong. I didn't think it would last this long, or get as far along as it is. But its so damn addicting. You get one part done, and then you can see how that part will enable another cool part to work. So you start working on that.
So i would say my drive is everything that i've been learning. And the satisfaction of what i have been able to do so far. My OS is doing nothing new or revolutionary. Its just doing the same stuff thats been done many times before it. But its a lot of fun. It would be cool if even a small community formed around my OS. But i dont really count on it. In the future possibly i'll have the knowledge to go about designing things in a better more efficient manner. but for now simplicity and making it work in general is what i'm striving for.
I dont work on Zenobit / CITADEL because it's fun, I do it because I want to create something that is either commercial quality or atleast useful to someone.
That being said, A great motivator for work is that of learning how to accomplish more and more advanced things. So, I guess with me its all about creating something that people can find interesting and through that, becoming a greater programmer.
Apart form that... I want to create something somewhat unique.
I use to be addicted to it because of the sense of accomplishment.
I mean the first time I got my OS to boot without triple faulting, when I got a basic console, my first multitasking test...
Then I made the fatal mistake of actually designing my OS. It was a horrible idea because I would design for a few hours. This didn't give me any feeling of accomplishment..And when I finally got around to trying to code it, I would find a design flaw and redesign that bit..
For me it's always the same, I loose motivation when I know that I can do it. When I go from problemsolving and learning to pure work, sometimes I'm lucky enought to code while I'm still learning/solving problems, and thats when I get results.
Eh, btw.. If you want me to remove the signature I will. But I do think it's funny