Page 1 of 1

fuze64 - A small long mode kernel

Posted: Thu Oct 15, 2009 2:33 pm
by dosfan
Hi

Below is a screenshot of my new long mode kernel. It currently consists of:
  • IDT & GDT routines
  • Simple VGA console driver
  • Kernel Page allocater (stack based)
  • Kernel Heap allocater (bitmap based)
  • LAPIC/SMP initalization routines
  • Boots with standard GRUB (kernel contains a 32bit bootstrap entry point)
The screenie shows it parsing the MP tables and bringing up a couple of APs. The APs enter the kernel, setup a new stack and loop incrementing a byte in video memory (top left). I've tested it successfully on a range of SMP capable PCs and laptops with success.

Nothing experimental or interesting about this project. My main interest with this project is SMP right from the start.

..will bore you with more details once it's more complete :)

Re: fuze64 - A small long mode kernel

Posted: Thu Oct 15, 2009 6:57 pm
by earlz
very neat looking..

umm maybe a download link or something?

Re: fuze64 - A small long mode kernel

Posted: Fri Oct 16, 2009 2:30 am
by qw
Please, bore us some more!

Re: fuze64 - A small long mode kernel

Posted: Fri Oct 16, 2009 8:53 am
by Creature
Is there any website or repository we can view sources at? It's always nice to look at something you've not succeeded in doing yet ;).

Keep up the good work!

Re: fuze64 - A small long mode kernel

Posted: Sat Oct 17, 2009 4:39 am
by dosfan
I'm not really into doing releases or using source control for that matter.

But since there is a small amount of interest, the source is attached below. It's just an achive or where I'm currently at.

It won't compile in its current state as I've had to remove the printf implmentation used. I'm not sure about the license of that code. (It's the Lars & Linus vsprintf....) Plug your own in or comment/#define the calls out. Makefile sucks, you'll probably need to fix that too!

No explicit license attached, do what you want with it. I may in the future release the project under a BSD license though. I'd appreciate it if you could me a PM if you do anything interesting with it :)

Hope it helps someone....
Cheers

Re: fuze64 - A small long mode kernel

Posted: Sat Oct 17, 2009 6:29 am
by f2
dosfan wrote: Hope it helps someone....
Very interesting. It will help me to understand better the x86_64 architecture.

Re: fuze64 - A small long mode kernel

Posted: Thu Nov 12, 2009 3:33 am
by 13th
dosfan!
I have trouble compiling the code you posted
the error I get is:
make: /usr/cross/x86-64/bin/x86_64-elf-gcc: Command not found

I tried it on Ubuntu 9.04 x64

What am I doing wrong?

Re: fuze64 - A small long mode kernel

Posted: Thu Nov 12, 2009 3:40 am
by AJ
Hi,

You need a GCC Cross-Compiler for x86 64. By the look of the error, the makefile uses absolute paths to the compiler, so if you already have the Cross Compiler and it is not working, it needs to be installed in /usr/cross/x86-64/bin. Alternatively, edit your PATH variable and edit the makefile so that it doesn't supply the full compiler path.

Cheers,
Adam

Re: fuze64 - A small long mode kernel

Posted: Tue Nov 17, 2009 3:12 pm
by dosfan
13th wrote:dosfan!
I have trouble compiling the code you posted
Hi. As AJ said the makefile uses absolute paths. I did mention the makefile was pretty useless and I only released the code in its current form because people were asking. Sorry.

The screenshot below shows the current version loading an ELF binary from an EXT2 filesystem with the page faults doing the work. It's the usual "Hello, world!" but there is no syscall interface. It is of course ring3 :D

Re: fuze64 - A small long mode kernel

Posted: Wed Nov 18, 2009 2:36 am
by AJ
Hi dosfan,

Hopefully this will be seen as constructive criticism, but I'd look in to that Makefile thing.

You have made an announcement and generated some interest in your kernel. This means you have a great new resource: willing testers! By making the build process as simple as possible, you should (hopefully) get some useful feedback.

I know I'm jumping the gun, because you only originally intended to release a screenie at this stage, but make use of the people who have shown that initial interest. Just my two penn'orth :)

Cheers,
Adam

Re: fuze64 - A small long mode kernel

Posted: Wed Nov 18, 2009 1:39 pm
by dosfan
AJ wrote:Hi dosfan,

Hopefully this will be seen as constructive criticism, but I'd look in to that Makefile thing.

You have made an announcement and generated some interest in your kernel. This means you have a great new resource: willing testers! By making the build process as simple as possible, you should (hopefully) get some useful feedback.

I know I'm jumping the gun, because you only originally intended to release a screenie at this stage, but make use of the people who have shown that initial interest. Just my two penn'orth :)
QFT. I do appreciate the interest shown. Unfortunately, due to RL I don't have the amount of time available to code that I'd like. (I do 90% of my hobby coding on the train on the way to work). This means half a**ed Makefiles and the like.

There was also part of me which suspected the post was a troll attempt because I thought I made it clear it wouldn't even link nevermind a botched Makefile.

I take your comments on board with spirit you intended. My next "release" will be of a higher standard :)