Live data from Hacker News

Kernel 101 – Let’s write a Kernel

arjunsreedharan.org

21–30 of 104 posts

Re: Kernel 101 – Let’s write a Kernel

#21

I really like the new HN. Quality of articles is way up.

I've found myself spending a lot more time here as well. Was there any code/policy change with the HN site? Or is this new moderators jumping in and helping out a lot? Either way, I agree that it is excellent.

Re: Kernel 101 – Let’s write a Kernel

#22
If anybody is doing this, let me share some words of advice based on experience.

Please use a virtual machine instead of doing this on your primary machine. You eliminate the risk of messing up your machine. Also, if you setup the VM properly, you get a debugger.

Re: Kernel 101 – Let’s write a Kernel

#23

Looks great, will keep an eye on this! I also really enjoyed James Molloy's OS kernel development tutorial at http://www.jamesmolloy.co.uk/tutorial_html/ , which takes you from "Hello World" to some real toy OS kernel implementation.

Thanks for sharing that link.

I have seen James tutorial a while back, and I agree. He does a great job.

Re: Kernel 101 – Let’s write a Kernel

#25
post #14

Great! except that to be called a kernel it's missing just a process manager, memory manager, filesystem, process separation and hardware abstraction. Yeah I'm that guy, down vote me as you wish, the article is still wrong. It's a way to load a ring-0 application into grub. Pretty cool, but not a kernel.

There are plenty of kernels which don't do most of the things you mentioned.

Re: Kernel 101 – Let’s write a Kernel

#26
post #25
post #14

Great! except that to be called a kernel it's missing just a process manager, memory manager, filesystem, process separation and hardware abstraction. Yeah I'm that guy, down vote me as you wish, the article is still wrong. It's a way to load a ring-0 application into grub. Pretty cool, but not a kernel.

There are plenty of kernels which don't do most of the things you mentioned.

They are called libraries.

Re: Kernel 101 – Let’s write a Kernel

#27
post #5

I'm not exactly Linus Torvalds but I'm pretty sure a program that prints one line of text is not "a kernel". :)

I'm going to give OP the benefit of the doubt on this one. A couple things worth noting, it successfully boots, does not cause a fault of any kind, and is in a position to interact directly with the bare metal. The tools that we use to interact with a *nix system are often just that, bits of code in user-space. This is a kernel-space program. That it does not do any of the memory management or device access yet doesn…

Come on, no. It is not a kernel. It's a program that runs "on bare metal".

Let me define what a piece of code needs to do to be a "kernel": it needs to manage some resources to allow other programs to run using those resources. E.g. memory, cpu time, I/O peripherals etc.

You know a kernel when you see one.

Re: Kernel 101 – Let’s write a Kernel

#28
post #19
post #17

Earlier quoted context omitted.

It's a statically linked program, real memory, diskless system, kernel-mode-only kernel without too much fluff in the video i/o abstraction.

Kernel means "core". Kernel-mode-only kernel is a contradiction. If you don't have separate parts, you can't have a core.

So if you write core software for an architecture without privsep you must not call it a kernel?

Re: Kernel 101 – Let’s write a Kernel

#29

Very cool. I personally (as a developer without a CS background) find these sorts of posts wonderfully interesting, even if this kernel, as pointed out in this thread, lacks a lot of what a normal kernel does. I'd love to see one of these for a compiler!

Writing an expression parser is probably the compiler "equivalent": http://www.strchr.com/expression_evaluator

Re: Kernel 101 – Let’s write a Kernel

#30
post #28
post #19

Earlier quoted context omitted.

Kernel means "core". Kernel-mode-only kernel is a contradiction. If you don't have separate parts, you can't have a core.

So if you write core software for an architecture without privsep you must not call it a kernel?

I'm not talking about privsep, just different modules. I gonna answer you with another question:

Did MS-DOS had a kernel?

Post reply on HN