OS dev tutorial

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
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

JamesM wrote:Zacarias - did you look at my tutorials? I posted the link above. They're very similar in starting point to Bran's tutorials, I've just started them, and would really appreciate it if you could give them a read and see if they're 'too geeky' too, or any other comments.

link again: http://www.jamesmolloy.co.uk

JamesM
i have looked at it, but the thing is that im kinda weird in some ways. One of the main reasons i like this other tutorial is that only ASM is used. I hate doing all this low lvl stuff in a high lvl language. C IS a fantastic programming language, but i hate it anyway... Atleast i do with this kinda stuff.

Ya, i know its hilarious...
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

i have looked at it, but the thing is that im kinda weird in some ways. One of the main reasons i like this other tutorial is that only ASM is used. I hate doing all this low lvl stuff in a high lvl language. C IS a fantastic programming language, but i hate it anyway... Atleast i do with this kinda stuff.

Ya, i know its hilarious...
Nothing weird about that at all, many people (like Dex, for example) prefer ASM to C. Personal preference. I was just hankering after some opinions ;)

JamesM
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 »

Zacariaz wrote:
Combuster wrote:I suggest you list all of Brendan's posts :wink:)
It is funny... Again and again "Brendans" tutorial is mentioned however i have yet to see a link to it.
You are mixing things up - You have Bran's kernel development tutorial (or Brandon, which is his full name), and you have Brendan, which afaik didn't write any tutorial.
"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
B.E
Member
Member
Posts: 275
Joined: Sat Oct 21, 2006 5:29 pm
Location: Brisbane Australia
Contact:

Post by B.E »

I think this tutorial focuses more on the theory side and uses code snippets to clarify rather then solve problems.

The problem with a lot of other tutorials is that they give code without clearly explaining WTF it's doing and how the author actually got to that solution (Like Bran's tutorial). This means that forums like this one have to deal with <insert not so nice words> problems.
Image
Microsoft: "let everyone run after us. We'll just INNOV~1"
User avatar
Zenith
Member
Member
Posts: 224
Joined: Tue Apr 10, 2007 4:42 pm

Post by Zenith »

B.E wrote:The problem with a lot of other tutorials is that they give code without clearly explaining WTF it's doing and how the author actually got to that solution (Like Bran's tutorial).
I agree. Its stupid how few of these 'OSdev tutorials' actually teach you OSdev - Some of them just tell you step by step how to write each part without explaining why/how, and others just dump code on you.

This tutorial (the one in the first post), shows some promise except for some of the errors in it (the last two sections of the tutorial claim to load the kernel at 1 MB, but instead loads it at 0x10000 (64KB!)). :shock:

Sadly, its still better than most... :(
"Sufficiently advanced stupidity is indistinguishable from malice."
User avatar
jerryleecooper
Member
Member
Posts: 233
Joined: Mon Aug 06, 2007 6:32 pm
Location: Canada

Post by jerryleecooper »

edit: the tutorials on task switching are good!! :D
And my task switching code is working fine now!! :D
At last, I have a working kernel :lol:
Last edited by jerryleecooper on Mon Aug 27, 2007 9:37 pm, edited 1 time in total.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Post by neon »

This tutorial (the one in the first post), shows some promise except for some of the errors in it (the last two sections of the tutorial claim to load the kernel at 1 MB, but instead loads it at 0x10000 (64KB!)). Shocked
As the author of the tutorials, I have been noted of that little problem, and it has been fixed.

Sorry about that :oops:

I am currently only using NASM. I personally would like support for different compliers and tool chain, however. I am also very aware of the cross complier solution.

Some of the incorrect technical details I will see if I could fix those...
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

KEEP UP THE GOOD WORK!
I still think its very nice, and seemingly im ot the only one. ;)
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Post by neon »

Im currently trying to include a processor architecture section, and microprogramming--something even lower level then machine language itself. It is the language of the hardware itself, either built in or developed using a microassembler and stored in ROM, just like the BIOS POST itself.

This would complete the system architecture tutorial, and explains how software can control hardware.

While this does not relate to the kernel, it does relate to microcontroller programming, as microcode is the language of those microcontrollers.

Afterwords, I will go back to the next new tutorial (It has already started.)
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

I didn't realise that the x86 architecture had reprogrammable microinstruction decoders?
User avatar
B.E
Member
Member
Posts: 275
Joined: Sat Oct 21, 2006 5:29 pm
Location: Brisbane Australia
Contact:

Post by B.E »

neon wrote:Im currently trying to include a processor architecture section, and microprogramming
Can't wait

I've never heard of microprogramming until just then. I did a quick Google search on it, and seems very interesting (I'm a person who loves knowing the inside and out of devices, and Software (Operating systems and applications as well)). Is there official documentation on microprogramming.
Image
Microsoft: "let everyone run after us. We'll just INNOV~1"
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Post by neon »

JamesM wrote:I didn't realise that the x86 architecture had reprogrammable microinstruction decoders?
Microcode is still used, however, in the numerous Intel x86 compatible microprocessors like the Pentium 4 and AMD Athlon. However, within these designs, simple macroinstructions have one to four microinstructions (called uops or Rops, respectively) immediately generated by decoders without control store fetches.
Source

...Yep ;)
Is there official documentation on microprogramming.
Nope. Its very controller and device specific. You can get more information from wikipedia: HERE
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

Anyway i would suggest finishing and "finetuning" og tutorial or parts of the tutorial, before starting on the next.

Cant wait fpr whats to come ;)
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Taking microcode to new extremes, there is a project in my university that is a CPU on an FPGA (field programmable gate array). This isn't new, but they're trying (successfully) to make it so that part of the CPU can be changed (reflashed, whatever - changing the layout of the FPGA to essentially make a different piece of hardware) on the fly, while another piece is still running. This means that, for example, when booting a game, the CPU could change itself into a super matrix-mathematics machine, and be uber fast, then transform back into general purpose when it's finished. I love the idea!
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Post by neon »

That sounds very cool!

I hope their project succeeds!:D
Anyway i would suggest finishing and "finetuning" og tutorial or parts of the tutorial, before starting on the next.
I have been wanting to do that, actually.

I should probably note that I do not plan on ever going back into real mode. I plan on producing chapters for programming each controller directly from protected mode.

This is what I hope, anyways. i.e., basic mother board drivers.
Post Reply