Giter Site home page Giter Site logo

b-rich / metalkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mischief/metalkit

0.0 2.0 0.0 284 KB

A tiny set of libraries and a tiny bootloader for creating bare-metal programs for 32-bit x86

Makefile 0.88% C 88.12% Assembly 10.68% Python 0.32%

metalkit's Introduction

======== Metalkit

"Metalkit" is what I'm calling this set of software modules for assembling simple programs that operate on the bare metal: they run on IA32 PCs without any operating system.

This software is released under the MIT license, so you're free to copy, modify, and distribute it for commercial or noncommercial purposes.

What is this good for?

  • Learning about PC architecture or systems programming.

  • For hardware (or virtual machine) developers, writing test cases or example programs that demonstrate hardware features.

  • Simple applications (even games) that can target common virtual machines or emulators (QEMU, VMware, Bochs) as their platform.

  • Fun!

What can it do so far?

  • It has a nifty bootloader which can bootstrap a 32-bit protected mode program from either a raw floppy disk image (convenient for Virtual Machines), from GRUB (convenient for real PCs), or from a USB thumb drive (supports very large binary images).

  • When running from a USB disk on a BIOS that supports LBA mode, it can load very large binary images. I tested loading a 128MB image on my IBM Thinkpad.

  • It has simple PCI bus support. So far it's enough to enumerate the attached devices.

  • VGA text mode, with a simple Console abstraction.

  • Fault handlers, and a "red screen of death" for Panic and Unhandled Fault errors.

  • Support for 16-bit BIOS calls (switching back to real mode temporarily, then back to protected mode)

  • VESA BIOS graphics.

  • Interrupt handlers, very simple thread switching.

  • It has a simple PS/2 keyboard driver.

  • It supports basic PIT timer configuration.

  • Tested on VMware, Bochs, and a real PC.

How can I use it?

It's easy. On any x86 system with a 32-bit GNU toolchain installed, enter an example directory and type 'make'. You should end up with a '.img' file. You can either:

  • Reboot your PC, and use grub to boot this file as a 'kernel'.

  • Point your virtual machine or emulator of choice to boot.img as a floppy disk image.

  • Use 'dd' to copy the image to a USB disk, then use your BIO's boot menu to select the USB disk. Make sure to copy the image to the entire disk, not a single partition (like /dev/sdX, not /dev/sdX1).

What features are planned?

  • Higher-level libraries for threading.

  • An optional standard C library (probably newlib), for apps that need one.

  • Higher-level interfaces for video

  • A simple single-tasking event driven runloop.

  • Video, mouse, and keyboard drivers. (For generic PC hardware, and for VMware's mouse and video devices.)

  • Quake port?

metalkit's People

Watchers

James Cloos avatar B'Random Cliphord EiQ avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.