Page 1 of 1

My current state of mind after three weeks of OSDev

Posted: Wed Jun 10, 2009 2:06 pm
by gravaera
I found that it might be at least interesting if I put this down, just for the heck of it.

I started OSDev about three weeks ago. I feel good. It's very awesome, to be able to logically dissect a PC system, and put together a working, smooth, able-to-run bit of code.

However: Progress log of a noob. Before I begin, so as to help you understand what how I've worked, I have a generally high standard that I set for myself, and therefore, I have forced myself NOT to use anyone's code prepackaged. The only code I've taken from anywhere was the C++ Barebones (I've Dev'ing in C++) linker.ld script, and a small bit of the assembly from the Loader.s file.

By incorporating that with the C++ implementation of Constructor & Destructor calling I found at this site, I wrote out my own code by hand to add C++ class support. (I felt really good after that, for sure.) Oh, and for anyone reading this, and wanting to know how to go about starting off a C++ kernel, that link is pretty good. The man who wrote it didn't use ASM for anything other than his outb etc. functions, and everything is done in pure C++. It's good for a newbie, but you should probably seriously consider at least getting the basics of Asm down right.

I hate the idea of using even that bit of prewritten code, not because It's bad code. Far from it, but because I want o know that my kernel is entirely mine.

I started off barely understanding that much about how a computer works, and when I originally began, I couldn't even competently understand past the first page of the jamesmolloy kernel concept tutorial.

Yesterday, I successfully sat down and read all the way up to part 6, and felt really proud.

However: I'd like to state that you should always keep up with the code. Don't keep reading and not writing and implementing. A form of cathartic complacency has gripped me, and I realized it today. It's like..."Oh man. I'm so good. I can get thats stuff done in no time."

Yet all I've really done so far is get a bootable kernel by using grub, and implemented a VGA driver with scrolling, and whatnot. I've learned a whole lot, and I can easily go on now, into setting up interrupts, then the keyboard, and memory, but yet I haven't.

Why? I let it get to my head. I just was wondering: did this happen to anyone else? I learned an extremely valuable lesson today. You don't mean **** if you only know in your head, but can't implement.

Despite my "growth" in knowledge, I still have an extremely crude VGA implementation that uses about six overloaded versions of the same function (I called it putline()) to write to the screen, all for different types of output, and other reasons.

Not only is it crude, but it's also out of spec with what my original OS concept was.

I implemented the VGA driver as a directly manageable Real mode class, rather than as an abstract "stream" which was my idea.

My code has hardly any structure. I'm learning the invaluable importance of PROPER DESIGN.

I, with my current code have to call several different functions just to output to the screen.

I've decided to start over frm where I believe it would be wise, in keeping with the overall original concept of my OS, and implement a proper, or at least adjustable, and working Standard Library. Otherwise all that talk about my "Win Pool" idea was just that: talk.

I see how newbies really get in over their heads, and I see the humbling effect that OSDev has on a programmer. I honestly now comprehend the immense amount of time it will take to PROPERLY go about writing a stable, well structured OS.

I have everyone at OSDev, and especially the more experienced users, for just being so awesome. I try not to post any questions, and to rough it out, and learn what I need to on my own stakes, and so far I find that It's fully possible. But it's also good to read their posts and quietly meditate on what they say. Think about all of the possible meanings that thier statements can have, and examine the PC not as a static structure, but as a tool. A machine that runs code, and that can be manipuated.

Think outside the box. Just because something is implemented one way doesn't mean that that's the best, or only way to do it.

Once again, I thank the guys on the forum, and I wish all of the newbies who are here now to press on, and learn from the...gold mine that is here.

EDIT: Oh, and to NickJohnson, what you said in my first topic on the forum ever, where you spoke about the bloating concept, and the three stages idea. I found it really intriguing, by the way.

Other than that, I leave you all to your respective projects, and will seriously take mine by the scruff of the neck from now on.

Re: My current state of mind after three weeks of OSDev

Posted: Wed Jun 10, 2009 2:10 pm
by whowhatwhere
I know exactly what you mean. I also am glad to know that although we have a diverse community, there are people capable of articulating exactly what they mean in their posts. I've seen far too many 'zomfg wat do i do nao i need teh know' posts here so your post is very refreshing. Keep it up and you'll have a working piece very soon.

Re: My current state of mind after three weeks of OSDev

Posted: Wed Jun 10, 2009 2:13 pm
by piranha
Yeah, that happened to me.

My first kernel attempt got as far as a console with keyboard and a timer. After that, I had no idea how to implement MM. I tried for a about 1 month before giving up. So I went back, and tried to learn more C and more low-level kernel stuff.

Well, now I know more about this stuff, but I still haven't written my own versions, even though I could. I'm more focused on the higher level kernel stuff (VFS's, drivers, UI, etc). Once I get that to a good stage, I'm going to rewrite the lower level stuff.

Hey, at least you managed to get to where you are, so don't stop trying! Rewrite what you have a couple times, and write a design first so that your OS base is extremely solid.

-JL

Re: My current state of mind after three weeks of OSDev

Posted: Wed Jun 10, 2009 2:21 pm
by gravaera
Thanks guys. Now, in retrospect, when I look at that post where I'm all like "Revolutionary Networking OS!"...I almost cringe. I still have the idea in my head, and I'm still working toward that same goal...but the ATTITUDE I have now is COMPLETELY different. I mean...I was talking in that thread as if creating an OS that fully runs WIN32 code in a separate memory space, and catching API calls would be the easiest thing ever.

As if I could install some kind of filter, or alarm, and whenever a Win32 program makes a call, I, the genius, would be able to, oh-so-smoothly just catch that, and redirect it to some native module. I mean...It's so...noobish.

Anyway: as I learn, I grow. And that's at least something.

Re: My current state of mind after three weeks of OSDev

Posted: Wed Jun 10, 2009 3:41 pm
by earlz
Yea, we've all been pretty noobish back in the day(I still am sometimes lol)

Let's see..
sometime in 2005 I decided to learn C because you could make Dark Basic Pro plugins in it, which interested me. So I set out to learn the hello world crap but never really knew how to do it very well.. Then, I decided C was too hard, so I used this thing called BCX, a basic to C translator(which really did help me understand C some) Then... I though oh well, an OS sounds fun and set out ot make one..
JuleOS(Jule was another guy that I joined up with, though he never actually contributed. idk who he is now... )

It was made in Turbo C ugh. It was 16 bit and I learned C while creating it. I remember there was some bug in my display driver, and I looked and wondered if I put enough *'s next to vram. (I think it was char *vram) so I added one and it worked, I had no idea why at the time(I still actually think it's a coincidence it worked lol) and my code was horrible! but it did have disk support(through BIOS) and a paint program and mouse support and a workable command line.. but I still wonder how some of that code worked looking back on it...

Then I scrapped it and went to 32bit with JouleOS(first release January 2006). I learned a ton about pmode creating it, but my code was not workable, and I still didn't have C down too well... After about 8 months, the project died with nothing more but half-broken thread system, interupts, keyboard, COM port driver(this I still wish to port to my new OS sometime) and a video driver that could change modes by VGA ports...

I stopped OS deving for a long while these past two years, but I kept like reading and stuff, and I still thought about ideas..

Also, I learned C and most of C++ during these years.. like I worked on multiple projects, and am now good enough at C that I would call myself a pro(above novice, not quite guru though) and now I'm creating an OS, knowing what hte compiler generates, and such things.. and this OS is going much smoother and faster than any other one..

anyway!

You just have to keep learning and keep coding. I remember looking at paging code thinking it would be such a breeze to do while reading it. Then I go implementing it, and suddenly I'm missing a few things, which miss a few other thigns, and pretty soon, I discover it's not nearly as easy as it looks and that I must review what I read