2021-01-10 01:04:21 +00:00
|
|
|
# Draw a character using the built-in font (GNU unifont)
|
|
|
|
#
|
|
|
|
# To build a disk image:
|
|
|
|
# ./translate_mu_baremetal baremetal/ex4.mu # emits disk.img
|
|
|
|
# To run:
|
|
|
|
# qemu-system-i386 disk.img
|
|
|
|
# Or:
|
|
|
|
# bochs -f baremetal/boot.bochsrc # boot.bochsrc loads disk.img
|
|
|
|
#
|
|
|
|
# Expected output: letter 'A' in green near the top-left corner of screen
|
|
|
|
|
|
|
|
fn main {
|
|
|
|
var g/eax: grapheme <- copy 0x41 # 'A'
|
2021-01-23 00:44:23 +00:00
|
|
|
draw-grapheme 0, g, 2, 1, 0xa # x of 2 graphemes = 16px from top-left; y of 1 grapheme = 16px down from top-left
|
2021-01-10 01:04:21 +00:00
|
|
|
}
|