Page 1 of 1

BareMetal OS (64-bit OS written in Assembly)

Posted: Thu Aug 28, 2008 2:50 pm
by IanSeyler
BareMetal is a mono-tasking 64-bit OS for x86-64 based computers. The OS is written entirely in Assembly while applications can be written in Assembly (C/C++ is planned as well).

BareMetal boots from a hard drive and currently has a command line interface with the ability to load programs/data from a hard drive.

Current plans call for the ability to write data back to the disk, SMP support for taking advantage of multiple CPUs and CPU cores in data processing applications, and TCP/IP support.

http://www.returninfinity.com/baremetal.html

The OS is open source and can be compiled with NASM. I have also had success with booting the OS on real hardware via a CompactFlash to IDE adapter. There is still much to do but it has progressed pretty well so far. There are not too many open source 64-bit OS's out there so I decided to make my own.

Comments would be appreciated!

Re: BareMetal OS

Posted: Fri Sep 12, 2008 11:40 am
by IanSeyler
Version 0.01 is out now.

It includes various code cleanup and a streamlined initialization process. The INIT section prepares almost everything that the kernel needs and then jumps to it.

INIT is less than 8KB compiled. The Kernel is also less than 8KB compiled.

A new startup screen too. It shows how bad I am at designing an ASCII logo.
Image

Next to do is to properly parse the SMBIOS information to get data about the CPU(s) and Memory. After that is to initialize the other processors in the system.

-Ian

Re: BareMetal OS

Posted: Fri Sep 12, 2008 2:15 pm
by ChazZeromus
I'd like to know where to get a good 64-bit MP system for a good price. I've been obsessing over 64-bit computer ever since David A Cutler said "64-bit computer is the future".

Btw, good work on your Operating System.

Re: BareMetal OS

Posted: Fri Sep 12, 2008 2:35 pm
by IanSeyler
For a test system I use the following hardware:
  • Intel Celeron Dual-Core E1200
    Socket LGA775, EM64T, 1.6 GHz, 800 MHz FSB, 512KB L2 Cache, 65nm
This CPU cost about $50 CAD. I think it is the cheapest 64-bit dual core CPU out there. I never looked at what AMD offers though.
  • Intel Desktop Board DG31PR
    Socket 775 Intel G31 Chipset Dual-Channel DDR2 667/800 Integrated Intel Graphics Media Accelerator 3100 4X SATAII Giga LAN HD Audio Support 1333Mhz FSB Mirco ATX
The Motherboard was about $70 CAD. I just needed something simple.

Also picked up a cheap case and some RAM for it. I have been booting the machine from a compact flash to IDE adapter which I got from eBay.

-Ian

Re: BareMetal OS

Posted: Sat Sep 13, 2008 8:05 am
by Dex
Great work, its one of the best 64bit OS's i have seen, that also includes the source code,. The code is simple (like it should be ) and reads like a book, i may even port some of my OS's programs to it, if i get time.
I will post a link from my site, if you want.

PS: It run fine on my 64bit AMD
PPS:
Maybe you could add this:

Code: Select all

; -----------------------------------------------------------------
; os_wait_for_key -- Waits for keypress and returns key
; IN: Nothing
; OUT: AL = key pressed, other regs preserved
os_wait_for_key:
  hlt                        ; Put this here
  mov al, [kkey]
  cmp al, 0
  je os_wait_for_key

;mov byte [0xB8f9a], al	; put the typed character in the bottom right hand corner
  mov byte [kkey], 0x00	; clear the variable as the keystroke is in AL now

  ret
Because without it, you will be using 100% of cpu.

Re: BareMetal OS

Posted: Mon Sep 15, 2008 2:19 pm
by IanSeyler
Thanks for the tip Dex! QEMU no longer uses 100% of the CPU while it is running. It makes sense to have that function wait for an interrupt to be tripped.

Go ahead and post a link if you would like. Publicity couldn't hurt :)

Re: BareMetal OS

Posted: Thu Nov 20, 2008 11:27 am
by IanSeyler
v0.02 is out now.

Changes were minor but include the following:
* Using Pure64 to setup the computer before BareMetal is loaded and started.
* Ability to run flat binary C programs. Linker script is included. (No real C library yet)
* Misc code cleanup and fixes.
* Kernel loads at the 2MB mark.
* Apps load at the 3MB mark.

Image
Image

Re: BareMetal OS (64-bit OS written in Assembly)

Posted: Wed Dec 17, 2008 1:16 pm
by IanSeyler
Version 0.2 is out now.

It contains a few new system calls and a lot of code cleanup. More comments in the source code as well.

Image
Image

Currently working on SMP support in the OS as well as PCI support.

-Ian