BareMetal OS (64-bit OS written in Assembly)

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
User avatar
IanSeyler
Member
Member
Posts: 326
Joined: Mon Jul 28, 2008 9:46 am
Location: Ontario, Canada
Contact:

BareMetal OS (64-bit OS written in Assembly)

Post 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!
Last edited by IanSeyler on Mon Jul 27, 2009 2:43 pm, edited 2 times in total.
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
User avatar
IanSeyler
Member
Member
Posts: 326
Joined: Mon Jul 28, 2008 9:46 am
Location: Ontario, Canada
Contact:

Re: BareMetal OS

Post 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
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
User avatar
ChazZeromus
Member
Member
Posts: 61
Joined: Sun Jun 22, 2008 4:09 pm

Re: BareMetal OS

Post 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.
Image
User avatar
IanSeyler
Member
Member
Posts: 326
Joined: Mon Jul 28, 2008 9:46 am
Location: Ontario, Canada
Contact:

Re: BareMetal OS

Post 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
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: BareMetal OS

Post 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.
User avatar
IanSeyler
Member
Member
Posts: 326
Joined: Mon Jul 28, 2008 9:46 am
Location: Ontario, Canada
Contact:

Re: BareMetal OS

Post 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 :)
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
User avatar
IanSeyler
Member
Member
Posts: 326
Joined: Mon Jul 28, 2008 9:46 am
Location: Ontario, Canada
Contact:

Re: BareMetal OS

Post 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
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
User avatar
IanSeyler
Member
Member
Posts: 326
Joined: Mon Jul 28, 2008 9:46 am
Location: Ontario, Canada
Contact:

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

Post 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
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
Post Reply