Skip to content

mchlmmc/x86-Assembly-Font-Renderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raster font renderer written entirely in Assembly

FASM-Enabled Intel x86 Assembly code, intended for usage in real-mode operating systems.

This code has only been tested on VirtualBox, not a physical computer. USE AT YOUR OWN DISCRETION!

Compiling

I assembled the font.asm file with Flat Assembler (https://flatassembler.net/) on Windows 10 with no Makefile. All of the programs that I used were:

  • flat assembler 1.71.39
  • HxD 1.7.7.0
  • VirtualBox 5.2.2

Instead of writing a linker script, for some reason I manually copied the assembled version of font.asm into the first sector of a file I created, called font.img, using HxD upon each build. Then, I ran it in VirtualBox to see the result. No debugging tools were used.

While this code should work in Protected and Long Mode, I have not tested it under such running conditions yet.

Output

If you run font.img in VirtualBox you can expect to see something very similar to below:

Demonstration Screenshot

WARNING: This bootloader ends in a busy loop, so your computer fan might go crazy if you leave it running for too long.

Making your own font

Run the tool FontGenerator.cs in Visual Studio, Visual Studio Code, MonoDevelop etc to generate a new fontdata.bin from a font.txt file in the same running directory. Then, copy the contents of fontdata.bin to the first and second sectors of font.img. The format for font.txt should be rather intuitive, but if you do not understand it then there is a full outline in the FontGenerator.cs file.

Use the following ASCII Table for reference if you are unfamiliar with the standard:

ASCII Table

About

Bootloader that draws characters from a 5x7px font

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published