Last update March 7, 2012

Kernel With D



Several people have tried writing an Operating System kernel with D.

Table of contents of this page
Projects   
Titan   
Llama/osian   
OKL4 IPC into D   
Operating System Concept 'B'   
Mike Wynn's DKernel   
DKernel Revisited   
Related Topics   
Some starter code for an operating system   
Classes and libraries   
Compiling in Binary format   
SANOS   
Links   


Projects    

Titan    

Titan is an exokernel project using 100% D and ASM. Developed in 2006 by Trevor Parscal, Daniel Kreig, and Kyle Furlong the project is now at a stand-still. At this point, no further development is specifically planned.

Another D project has leveraged the code and research of DsourceProject:titan to get started - and others are welcome to do the same.

See also: NG:digitalmars.D/29040, NG:digitalmars.D/29077, NG:digitalmars.D/30881

Llama/osian    

OKL4 IPC into D    

I've started work on creating an OS using the D programming language. As the foundation I chose the OKL4 microkernel, but I am left with one big problem now, and that is the IPC code generation. Any software in C written to run on top of OKL4 would use code generated from IDL, but it seems to me that such is not the way to go with D. So I'd like to be able to use just a D interface, and then have it somehow be exposed via IPC. Ideally the way D interfaces are called would be compatible to IDL interfaces, but that is not a strict requirement (i.e. if such comes with a couple of disadvantages, we probably shouldn't do it, otherwise it's probably the way to go). ( source)

Operating System Concept 'B'    

Mike Wynn's DKernel    

http://www.geocities.com/one_mad_alien/dkernel.html

DKernel Revisited    

I don't know what "simple kernel" you found - there are several out there. The one I've played around was Mike Wynn's. It compiles, runs and supports classes.

Be warned that it is quite rudemental and certanly contains bugs.

http://dkernel.kuehne.cn/dkernel-current.zip (an updated dkernel version)

Source: NG:digitalmars.D/12663

Related Topics    

Some starter code for an operating system    

It basically has just 4 parts that are finished/working:

  1. An interface to be loaded by a multiboot compatible boot loader
  2. A text driver
  3. A memory manager which uses paging and can keep track of 4GB of memory. (simple reservation system, kmalloc, etc.)
  4. A tool for automatically creating a bochs hard drive image after each compile, which allows for very fast testing.
Anyhow, if you're interested, you can download it here: http://members.shaw.ca/bradenm_k/misc/picos2004a.tar.gz

I don't claim to be a great programmer, and this was my first operating system. Nonetheless, I feel it may be helpful to someone.

P.S. The last compiler I used for this was either DMD 0.92 or 0.93 - perhaps you might get some new compiler errors/warning due to deprecated features. Also, the Makefiles are all set up for Linux. It would be a lot of work to get this to compile on Windows.

Source: NG:digitalmars.D/6448

(Backup: http://dkernel.kuehne.cn/picos-current.zip)

Classes and libraries    

I found a simple kernel written in D. But it should be compiled with a really old dmd release...

Is there anyone who know to make a simple operating system in D made up of a boot loader and a kernel?

Hi, I have spent some time to get a basic "kernel" (I wouldn't call it a kernel yet) to boot. It's possible to do screen output but no input yet. That would be next. But getting input already requires a lot of pre-work with interrupt controlers etc.

I'm trying to make it but it's hard to link D object files with libraries.

Hard? Hmm... The thing is, you can't use any libraries because those functions are using operating-system functions. And those are not available for your own kernel. So you first have to implement all functions that the library uses before you can use this library to futher compiler programs.

It works fine by compiling the kernel without using any library, but i can't use classes and other D stuff without them!

Not true. You can use classes but you can't use the posted code here. Try to get phobos to work, than you can compile most of the avaiable (non-gui) code.

I need to specificy -Ttext 0x10000 (to set the text section entry point) but i can't if i link libraries...

I don't what you try to do with libraries. Just forget them when doing a kernel. You need to be able to create a special executable and boot this one. I just used "grub" for this and an ELF exectuable.

Source: NG:digitalmars.D/12785

Compiling in Binary format    

How do I compile the kernel in binary format (not PE/ELF/etc.)?

Source: NG:digitalmars.D/15507 by Robert M. Münch

SANOS    

I did search the D news groups and found no previous reference to SANOS.

How about translating this in D ?

http://www.jbox.dk/sanos/

Sanos is a minimalistic 32-bit x86 OS kernel, written 98% C and 2%assembler, running on standard PC hardware. This enables you to run java server applications without the need to install a traditional host operating system like Windows or Linux.

The kernel was developed as part of an experiment on investigating the feasibility of running java server applications without a traditional operating system only using a simple kernel.

The kernel implements basic operating system services like booting, memory management, thread scheduling, local and remote file systems, TCP/IP networking and DLL loading and linking. A win32 layer allows the Windows version of the standard HotSpot? JVM to run under sanos, essentially providing a JavaOS? platform for server applications. This enables you to run java based server applications, like tomcat and jboss, under sanos.

Alternatively, you can use sanos as a small kernel for embedded server applications written in C. Sanos has a fairly standard POSIX based API and an ANSI Standard C library. In this case you don't need the JVM and the win32 wrappers.

Sanos is open source under a BSD style license. Please see the COPYING file for details.

(from NG:digitalmars.D/30868)

Links    


FolderProjects
FrontPage | News | TestPage | MessageBoard | Search | Contributors | Folders | Index | Help | Preferences | Edit

Edit text of this page (date of last change: March 7, 2012 20:32 (diff))