Wrote and posted kernel-101 documentation

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
Jonathan Mcdougall

Wrote and posted kernel-101 documentation

Post by Jonathan Mcdougall »

I wrote a 25-page long document on how to setup your first kernel in Word format and uploaded it to http://membres.lycos.fr/preludesoftware/osdev.doc (111kb) in Word 2000 format and osdev.txt (40kb) in plain text (which I quickly generated from Word).

It is mainly targeted to Windows users. It is a first draft and much more will be added in the next few days. I expect the document to include informations about a C++ kernel, a simple memory manager, a basic C++ standard library, using the mouse and keyboard and finally the FAT32 filesystem by the end of the month, so check often.

Those interested to be contacted for updates can email me at [email protected]. Ideas and critics are welcomed.

Preface
Introduction
1. What you need (basic tools, integrating cygwin tools in VC++ 6.0 IDE)
2. Your first kernel (very simple commented ASM kernel)
3. Compiling 'n linking (using make, NASM, ld with a commented script and objcopy)
4. The image (using grub, partcopy and winimage)
5. Bochs (using and configuring Bochs)
6. Booting (Unfinished, booting with Bochs)
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Wrote and posted kernel-101 documentation

Post by Pype.Clicker »

what about a pdf version for lusers like me that have no decent .doc viewers linked to their browsers ?
::)

on page 5:
Cygwin is a Linux-like shell working on Windows.
Actually, it's much more than a shell: it's a complete port of most development tools you use daily on a unix system (make, gcc, ld, less, info, and many many more)

on page 8:
Command
c:/bochs/bochs.exe
are these slash's or backslash's ?

all in all, that seems to be rather a good document, probably more targetted at younger audience that tells step by step how to set up a OSdev'ing environment ...

maybe it lacks a "reference" section with all the download links, documentation centrals, etc.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Wrote and posted kernel-101 documentation

Post by Solar »

All in all, good read so far.

But perhaps needlessly complicated in some places. Think about:

* why not use the Cygwin shell, but instead doing all that copying of Cygwin exe's to alternative locations?

* why download NASM for the measly couple of ASM lines - you already have GAS with GCC?

* why make the objdump wrapper into an executable, if all it does is an alias? A one-line DOS script or Cygwin-shell alias should suffice...

* you repeatedly mention C++, but the init.asm you describe doesn't jump into C++ code, and does nothing to provide C++ support.

Just think about the above. And, dude - what do you mean, a "basic C++ standard library"? I fear you're in for a rude surprise as to what that would entail. I'm just about to release my first throw at a freestanding C library (by definition a subset of the C++ lib), and boy, it ain't funny to go there... but the best of luck to you. ;)
Every good solution is obvious once you've found it.
Tehy

Re:Wrote and posted kernel-101 documentation

Post by Tehy »

Very good document :) This will help me a lot :)
Jonathan Mcdougall

Re:Wrote and posted kernel-101 documentation

Post by Jonathan Mcdougall »

Responding to tow posts here.
* why not use the Cygwin shell, but instead doing all that copying of Cygwin exe's to alternative locations?
Good point. I did that personally for some reasons, but they don't apply here.
why download NASM for the measly couple of ASM lines - you already have GAS with GCC?
Because I don't know about gas and the asm kernel will get bigger.
why make the objdump wrapper into an executable, if all it does is an alias? A one-line DOS script or Cygwin-shell alias should suffice...
A batchfile would do the job, good idea.
you repeatedly mention C++, but the init.asm you describe doesn't jump into C++ code, and does nothing to provide C++ support.
I know, give me a couple of days. I wrote that thing in 5 hours straight and much more is coming.
Just think about the above. And, dude - what do you mean, a "basic C++ standard library"?
I mean exactly that.

=======================================
what about a pdf version for lusers like me that have no decent .doc viewers linked to their browsers ?
I'll see what I can do
are these slash's or backslash's ?
I stick with slashes throughout the document, though I could change them all to backslashes. Yeah, good point, I'll do that.
all in all, that seems to be rather a good document, probably more targetted at younger audience that tells step by step how to set up a OSdev'ing environment ...
Exactly, like I was a couple of months ago :)
maybe it lacks a "reference" section with all the download links, documentation centrals, etc.
Give me a couple of days and you'll have that.


Jonathan
Jonathan Mcdougall

Re:Wrote and posted kernel-101 documentation

Post by Jonathan Mcdougall »

Just uploaded an update, still at http://membres.lycos.fr/preludesoftware/osdev.doc.

Pype.Clicker notified me that he made a PDF version of the document's first version at http://www.atlantisos.com/mirror/osdev_tut/osdev.pdf. Perhaps he will make another one for the update, I don't know.

By the way, I am searching for a free host where I could put the document in html format. Does anybody know about one?

Thanks,

Jonathan
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Wrote and posted kernel-101 documentation

Post by Pype.Clicker »

chances are that *candy* notified you, not me ...
Jonathan Mcdougall

Re:Wrote and posted kernel-101 documentation

Post by Jonathan Mcdougall »

<quote>
chances are that *candy* notified you, not me ...
</quote>

Your are quite right, I messed up the nicknames since you were the one who talked to me about a pdf version. Sorry for the troubles.

Jonathan
Tehy

Re:Wrote and posted kernel-101 documentation

Post by Tehy »

I got one problem.
I'm trying to link my files like the tutorial tells me to do
c:/utils/nasm.exe -f elf init.asm -o init.o ld -T link.ld -nostdlib -o kernel.tmp init.o

but i got this error:
nasm: error: more than one input file specified
nasm: error: unrecognised option `-T'
nasm: error: more than one input file specified
nasm: error: unrecognised option `-n'
nasm: error: more than one input file specified

I hope someone could help me :)
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re:Wrote and posted kernel-101 documentation

Post by df »

c:/utils/nasm.exe -f elf init.asm -o init.o ld -T link.ld -nostdlib -o kernel.tmp init.o
that should be ld not nasm. your using a link command line with the assembler
-- Stu --
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:Wrote and posted kernel-101 documentation

Post by Neo »

df wrote:
c:/utils/nasm.exe -f elf init.asm -o init.o ld -T link.ld -nostdlib -o kernel.tmp init.o
that should be ld not nasm. your using a link command line with the assembler
Just in case you didn't get it. That means that the above line is actually 2 seprate commands not a single one the first being

Code: Select all

c:/utils/nasm.exe -f elf init.asm -o init.o 
and the next being

Code: Select all

ld -T link.ld -nostdlib -o kernel.tmp init.o
Only Human
IRBMe

Re:Wrote and posted kernel-101 documentation

Post by IRBMe »

Not too bad at all. I myself am just a beginner to the os dev scene, and so I'm making an attempt to document the exact steps I took and the knowledge I learn, as I learn it, I'm writing in a tutorial-like format, as I go along so other people can read and hopefully follow it in the future. So far, it's looking very much like yours, only a bit more detailed. I guess you beat me to it :P More documentation and tutorials, however, are always welcome in the OS developement world I think.
Post Reply