about summary refs log blame commit diff stats
path: root/baremetal/ex4.mu
blob: 52b681bcb31fb1d167c8163fbf3f520b5bb528df (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                               
# 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'
  draw-grapheme 0, g, 0x10, 0x10, 0xa
}