Another lamb to the slaughter...

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
Post Reply
Gaidheal
Member
Member
Posts: 51
Joined: Mon Oct 04, 2010 6:23 pm

Another lamb to the slaughter...

Post by Gaidheal »

Aye, that's right, I am yet another deluded programmer who's set his cap at handcrafting an OS, or at least a kernel, himself. ;¬)

More seriously, this is just a "hello!" ('Hello World!' ?) post and quick description of my aims and choices. I'm open to discussion and even advice but I have pretty much settled on a couple of points, so please don't take offence if I read and then ignore something suggesting contrary to those.

My immediate goal is a 16 bit, real mode, 'proof that Gaidheal can write something which will boot' project. I don't expect this to take very long and I started it in earnest about saturday, however I'm not rushing it, as all the more general reading I'm doing along the way should serve me well with the real goal. I have to say that this place was a bit of a find; a lot of the topics I'm thoroughly grounded in but one or two articles have really helped me plug holes in areas where I was a lot less sure.

The ambitious project - the 'real' one - is a 64 bit exokernel, followed by implementations of important and necessary OS functionality, though many decisions about those are yet to be made. I'm going to write it in assembly (using the Flat Assembler (Fasm), in fact). Aye, really, assembly code. I'm also specifically targeting the AMD64 architecture, running in 'long mode'. At present and for the forseeable future, I have no interest in targeting anything else (ignoring my warm-up project above).

Anyway, thanks for reading this and hope to catch up with some of you over the coming weeks and months.

Oh, thanks, too, for collectively creating this jewel of a resource.
TylerH
Member
Member
Posts: 285
Joined: Tue Apr 13, 2010 8:00 pm
Contact:

Re: Another lamb to the slaughter...

Post by TylerH »

Since you're using Fasm, you might as well make yourself at home on Fasm Board too. Maybe you'll get to see some of bitshifter's asm work. :)

Your ideas are pretty cool. I guess everybody starts with a RM "Hello World" type OS, so you're definitely not alone there. Anyway... welcome to the forum.
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Re: Another lamb to the slaughter...

Post by piranha »

Well, from a simple read of your post, you seem to know what you're talking about. I assume that you've been programming for a while, and know basic computer architectures. With research and perseverance I'm sure it'll work out. Your post was eloquent and well thought out, and the fact that you seem to know your stuff gives you a leg up on many of the other newcomers here.

Good luck!

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Gaidheal
Member
Member
Posts: 51
Joined: Mon Oct 04, 2010 6:23 pm

Re: Another lamb to the slaughter...

Post by Gaidheal »

I was lucky with my birth; good time (although a decade earlier and I might have been a legend! ;¬) ), father is hobbyist in electronics, radio, computers, etc and was from being a lad himself (he's an electronics engineer, by trade, taught himself, joined the RAF and left to work for what was then Marconi Avionics). As a result, we were actively encouraged to show an interest and play with this stuff ourselves (my sister is a fairly competent electronics engineer and could program at a push, too) from an early age. I started programming on the BBC B+ when I was around seven and actually learnt a bit of 6502 assembler before my father got me a C compiler (yay!). I never really looked back but I sometimes wonder what would have happened if I'd stuck with assembler from such an early age, actually. I revisited it when I was a lot older, as a result of having friends who knew and used one dialect or another but I have to say that learning C was probably 'smarter' overall and I have watched various talented assembler coders struggle with a different architecture and then feel even more lost when they try a high level language instead; for all that I do like assembler and will champion its advantages, there are distinct disadvantages to being so closely tied to the hardware.

Anyway, thanks for the welcome guys, and I think I might actually be registered on the Fasm board already... if not it's only because I meant to but haven't had anything worth sharing, so haven't been forced to actually go through with registration.

P.S. Late here (I was out for my game night) so I might be rambling a bit, apologies.

[edit: it was a BBC B, with 32 KiB, not B+ but I've left the post alone and added this, on principle ;¬)]
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: Another lamb to the slaughter...

Post by gerryg400 »

Welcome and good luck in 64 bit land.

Why fasm instead of c ? Seems like you were saying c might be more suitable in another thread. NOTE: This is not meant to begin another holy war, just curious.
If a trainstation is where trains stop, what is a workstation ?
Gaidheal
Member
Member
Posts: 51
Joined: Mon Oct 04, 2010 6:23 pm

Re: Another lamb to the slaughter...

Post by Gaidheal »

I don't do "holy wars", I'm an atheist!

But seriously, why the warm-up in assembler? To practice writing with Fasm again, on a project which is simple enough that 'learning on the job' to a point (refresher, actually, I've used Fasm before) isn't going to bury it.

Why write the kernel in assembler? Kernels pretty much should be written in assembler, in my opinion. It doesn't get more 'bare metal' than bootloaders and kernels (aside from device drivers, perhaps, if you don't implement some sort of HAL) and you cannot get much more 'low level' in language terms than assembly code (unless you want to do machine code, and I have, but that's just silly in all but truly exceptional cases).

In the other thread I observed that C was designed for writing an Operating System, which it was but remember that a design goal of that OS was a largish degree of hardware independence. Now consider that I am writing, well intending to write, an exokernel which will not run any hardware that is not AMD64 or able to fully emulate an AMD64 CPU. Potentially it could run, at least this is my intent, on a non-PC architecture, since it's going to need to be bootstrapped and the only assumptions that it will make are directly tied to the AMD64 environment - it will execute in long mode, it will assume that all registers are 64 bit and that there are sixteen 'general purpose', etc.

Also, the project is multifold all the way; it's as much to give me a thorough, truly thorough, grip on the AMD64 architecture as it is to give me a really thorough grip on system level programming, kernel implementation and device drivers, whilst also familiarizing myself, once again, with assembly coding and Fasm's dialect.

Is C an excellent choice for a lot of people who want to write a kernel? Absolutely, especially if they are going to implement 'tried and tested' solutions. It's an even better choice, probably, for writing the more complex parts of what most people mean by 'Operating System' such as the background handling of tasks, a GUI API and so on. It just suits me to write this project in assembly code; in essence, doing so is a 'design goal'. ;¬)
Gaidheal
Member
Member
Posts: 51
Joined: Mon Oct 04, 2010 6:23 pm

Re: Another lamb to the slaughter...

Post by Gaidheal »

Thanks!

Glad to have found this community and it's clear there are quite a few talented and driven programmers on here. Hopefully with your assistance I can avoid dead-ending the way many projects do when the designer(s) can't see their way out a problem or how to proceed further.
Post Reply