qscuio / bootlib Goto Github PK
View Code? Open in Web Editor NEWThis project forked from m-ou-se/bootlib
A minimalistic library to help making your x86 assembly program bootable.
License: MIT License
This project forked from m-ou-se/bootlib
A minimalistic library to help making your x86 assembly program bootable.
License: MIT License
Hai, The directory you just opened contains our 'bootlib' and a minimal example that uses it. 'bootlib' is a tiny library written in x86 assembly which should provide you just enough functionality to let you make your own bootable program without too much trouble. If you're using some form of Linux (x86 or x86_64), you should be able to use the example makefile: This makefile lets you use 'make' to compile your bootable image, and 'make test' to run it in the Qemu emulator (if installed). This file contains some hints on how to use things such as VGA output and keyboard input. You'll probably need a lot more information than what's given here, but this should give you a good start. Have fun! Maarten de Vries and Mara Bos [Booting your image] The file that comes out of the compiler should be a Multiboot ELF image, which can be loaded by a bootloader such as GRUB. If you want to run your program natively on your computer from your harddrive, you should configure your bootloader to add an option for your boot image. For example, if you're using Ubuntu with GRUB2: Put the image in a convenient place (such as /boot/) and add the following to /etc/grub.d/40_custom: (and run: sudo update-grub2) submenu "Custom boot images" { menuentry "My Awesome Program" { multiboot /boot/myawesomeprogram } } It is also fun to try to get your program running without a bootloader. Reading your a file from a harddrive with a file system can get pretty tough in assembly, but reading your image from a fixed position on a floppy should be pretty easy. [VGA output] Code is included that will set all VGA registers to get the graphics card into 16 color 25*80 text mode. If you want a different mode, you'll have to find out the values for all those registers yourself. In text mode, each block on the screen (of 8 by 16 pixels) will match two bytes in the the VGA memory (which starts at 0xB8000, also available as the symbol 'vga_memory'): one for the character itself (in ASCII), and one for the colour (four bits background, four bits foreground). It is possible to overwrite the default font, so you can display other kind of (8*16 pixel tiled) graphics. Code for this is not included. [Keyboard input] Any input from the keyboard fires IRQ1 (if enabled). After the IRQ fired, the keyboard controller might not be ready to give you the scancode yet. You'll have to wait for the 'ready bit' to turn on: Read a byte from 0x64 (inb $0x64, %al), and repeat until the least signifigant bit is one. Then, you can read the scancode (byte) from 0x60 (inb $0x60, %al). For a overview of scancodes, see http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html [License] See the 'LICENSE' file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.