]> git.mdlowis.com Git - proto/uefi.git/commitdiff
started working on bare-metal onward implementation
authorMichael D. Lowis <mike@mdlowis.com>
Thu, 9 Feb 2023 03:56:34 +0000 (22:56 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Thu, 9 Feb 2023 03:56:34 +0000 (22:56 -0500)
core/font.c [deleted file]
core/kernel.h [deleted file]
core/main.c [deleted file]
core/term.c [deleted file]
core/video.c [deleted file]
uefi/crt_x86_64.c
uefi/onward.S [new file with mode: 0644]
uefi/platform.h

diff --git a/core/font.c b/core/font.c
deleted file mode 100644 (file)
index 84fbb4c..0000000
+++ /dev/null
@@ -1,261 +0,0 @@
-#include <platform.h>
-#include <kernel.h>
-
-uint8_t Font[4096] = {
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd, 0x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x7e, 0xff, 0xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x99, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0x00, 0x00, 0x1e, 0x0e, 0x1a, 0x32, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30, 0x30, 0x70, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x7f, 0x63, 0x7f, 0x63, 0x63, 0x63, 0x63, 0x67, 0xe7, 0xe6, 0xc0, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, 0x3c, 0xdb, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x02, 0x06, 0x0e, 0x1e, 0x3e, 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x7f, 0xdb, 0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x6c, 0xfe, 0x6c, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, 0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00,
-       0x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x86, 0xc6, 0x7c, 0x18, 0x18, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18, 0x30, 0x60, 0xc6, 0x86, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xce, 0xd6, 0xd6, 0xe6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x7c, 0xc6, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xfe, 0x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xfe, 0xc0, 0xc0, 0xc0, 0xfc, 0x0e, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x38, 0x60, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xfe, 0xc6, 0x06, 0x06, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x0c, 0x78, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xde, 0xde, 0xde, 0xdc, 0xc0, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xf8, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x1e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xe6, 0x66, 0x6c, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c, 0x0c, 0x0e, 0x00, 0x00,
-       0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x6c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xd6, 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xc6, 0xc6, 0x6c, 0x6c, 0x38, 0x38, 0x6c, 0x6c, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xfe, 0xc6, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc2, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c, 0x00, 0x00, 0x00, 0x00,
-       0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
-       0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xe0, 0x60, 0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0xdc, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00,
-       0x00, 0x00, 0xe0, 0x60, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00,
-       0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0xfe, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x62, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x6c, 0x38, 0x38, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x70, 0x18, 0x18, 0x18, 0x0e, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x0c, 0x06, 0x7c, 0x00, 0x00,
-       0x00, 0x00, 0xcc, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x0c, 0x18, 0x30, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x10, 0x38, 0x6c, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xcc, 0xcc, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x38, 0x6c, 0x38, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x60, 0x60, 0x66, 0x3c, 0x0c, 0x06, 0x3c, 0x00, 0x00, 0x00,
-       0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xc6, 0xc6, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x66, 0x66, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x18, 0x3c, 0x66, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0xc6, 0xc6, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
-       0x38, 0x6c, 0x38, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
-       0x18, 0x30, 0x60, 0x00, 0xfe, 0x66, 0x60, 0x7c, 0x60, 0x60, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x76, 0x36, 0x7e, 0xd8, 0xd8, 0x6e, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x3e, 0x6c, 0xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xc6, 0xc6, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x30, 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x60, 0x30, 0x18, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0xc6, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0x78, 0x00,
-       0x00, 0xc6, 0xc6, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0xc6, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x18, 0x18, 0x3c, 0x66, 0x60, 0x60, 0x60, 0x66, 0x3c, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xe6, 0xfc, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0xf8, 0xcc, 0xcc, 0xf8, 0xc4, 0xcc, 0xde, 0xcc, 0xcc, 0xcc, 0xc6, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x0e, 0x1b, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0xd8, 0x70, 0x00, 0x00,
-       0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x0c, 0x18, 0x30, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x18, 0x30, 0x60, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x18, 0x30, 0x60, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x76, 0xdc, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
-       0x76, 0xdc, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x3c, 0x6c, 0x6c, 0x3e, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xc0, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x60, 0xce, 0x93, 0x06, 0x0c, 0x1f, 0x00, 0x00,
-       0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x66, 0xce, 0x9a, 0x3f, 0x06, 0x0f, 0x00, 0x00,
-       0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x66, 0xcc, 0x66, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x66, 0x33, 0x66, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44,
-       0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa,
-       0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77,
-       0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-       0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-       0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-       0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-       0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-       0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-       0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-       0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-       0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-       0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-       0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-       0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-       0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-       0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-       0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-       0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-       0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
-       0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-       0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
-       0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0xd8, 0xd8, 0xd8, 0xdc, 0x76, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xc6, 0xfc, 0xc6, 0xc6, 0xfc, 0xc0, 0xc0, 0xc0, 0x00, 0x00,
-       0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x80, 0xfe, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0xfe, 0xc6, 0x60, 0x30, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xd8, 0xd8, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xc0, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x7e, 0x18, 0x3c, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0x6c, 0x6c, 0x6c, 0x6c, 0xee, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x1e, 0x30, 0x18, 0x0c, 0x3e, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xdb, 0xdb, 0xdb, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x03, 0x06, 0x7e, 0xcf, 0xdb, 0xf3, 0x7e, 0x60, 0xc0, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x1c, 0x30, 0x60, 0x60, 0x7c, 0x60, 0x60, 0x60, 0x30, 0x1c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x0e, 0x1b, 0x1b, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
-       0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x6c, 0x3c, 0x1c, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0xd8, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x70, 0x98, 0x30, 0x60, 0xc8, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
diff --git a/core/kernel.h b/core/kernel.h
deleted file mode 100644 (file)
index 4e35be5..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-    Graphics Support
-*/
-#define FONT_WIDTH  8
-#define FONT_HEIGHT 16
-extern uint8_t Font[];
-
-static inline void Video_PutPixel(int x, int y, uint32_t pixel)
-{
-    Video.buffer[Video.stride * y + x] = pixel;
-}
-
-/*
-    Terminal/Console Driver
-*/
-void Term_Init(void);
-void Term_Clear(void);
-void Term_Print(char*, ...);
-void Term_PutChar(int c);
-void Term_PutString(char* s);
-void Term_PutInt(int64_t val);
-void Term_PutHex(uint64_t val);
-void Term_PutHex8(uint8_t val);
-void Term_PutHex16(uint16_t val);
-void Term_PutHex32(uint32_t val);
-void Term_PutHex64(uint64_t val);
-void Term_PutNewline(void);
\ No newline at end of file
diff --git a/core/main.c b/core/main.c
deleted file mode 100644 (file)
index 935e029..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <platform.h>
-#include <uefi.h>
-#include <kernel.h>
-
-int main (int argc, char** argv)
-{
-    Term_Init();
-    Term_Print("Done\n");
-    sleep(60000);
-
-    return 0;
-}
diff --git a/core/term.c b/core/term.c
deleted file mode 100644 (file)
index ef90847..0000000
+++ /dev/null
@@ -1,263 +0,0 @@
-#include <platform.h>
-#include <kernel.h>
-
-#define MAX_COLS 240
-#define MAX_ROWS 75
-
-static char* Digits = "0123456789abcdef";
-
-struct {
-    int cols;
-    int rows;
-    int cursor;
-    char cells[MAX_ROWS * MAX_COLS];
-} Term = { 0 };
-
-static void PutGlyph(int x, int y, char c)
-{
-    char* glyph = &Font[c * FONT_HEIGHT];
-    for (int row = 0; row < 16; row++)
-    {
-        char piece = glyph[row];
-        for (int col = 0; col < 8; col++, piece <<= 1)
-        {
-            Video_PutPixel(
-                x + col,
-                y + row,
-                (piece & 0x80) ? 0xFFFFFFFF : 0x00000000);
-        }
-    }
-}
-
-static void PutCell(int c)
-{
-    int max = Term.rows * Term.cols;
-    /* check if we need to scroll and do it */
-    if (Term.cursor >= max)
-    {
-        int dst = 0;
-        int src = Term.cols;
-        Term.cursor = (Term.rows - 1) * Term.cols;
-        while (src < max)
-        {
-            PutGlyph((dst % Term.cols) * 8, (dst / Term.cols) * 16, Term.cells[src]);
-            Term.cells[dst++] = Term.cells[src++];
-        }
-        for (int i = Term.cursor; i < (Term.cursor + Term.cols); i++)
-        {
-            PutGlyph((i % Term.cols) * 8, (i / Term.cols) * 16, ' ');
-            Term.cells[i] = ' ';
-        }
-    }
-    /* now place the new glyph */
-    Term.cells[Term.cursor] = c;
-    int row = (Term.cursor / Term.cols);
-    int col = (Term.cursor % Term.cols);
-    PutGlyph(col * 8, row * 16, c);
-    Term.cursor++;
-}
-
-void Term_Init(void)
-{
-    Term.cols = min(Video.width / FONT_WIDTH, MAX_COLS);
-    Term.rows = min(Video.height / FONT_HEIGHT, MAX_ROWS);
-}
-
-void Term_PutChar(int c)
-{
-    switch (c)
-    {
-        case '\r':
-            Term.cursor = (Term.cursor / Term.cols) * Term.cols;
-            break;
-
-        case '\n':
-        {
-            int next = (Term.cursor / Term.cols) * Term.cols + Term.cols;
-            while (Term.cursor < next)
-            {
-                PutCell(' ');
-            }
-            break;
-        }
-
-        default:
-            PutCell(c);
-            break;
-    }
-}
-
-void Term_Print(char* fmt, ...)
-{
-    va_list arg;
-    va_start (arg, fmt);
-    for (; *fmt; fmt++)
-    {
-        if (*fmt == '%')
-        {
-            int ndigits = sizeof(intptr_t);
-            fmt++;
-            if (*fmt >= '0' && *fmt <= '9')
-            {
-                ndigits = *(fmt++) - '0';
-            }
-            switch(*fmt)
-            {
-                case 'd':
-                    Term_PutInt(va_arg(arg, int));
-                    break;
-
-                case 'u':
-                    Term_PutInt(va_arg(arg, unsigned int));
-                    break;
-
-//                case 'f':
-//                    TODO
-//                    break;
-
-                case 'c':
-                    Term_PutChar((char)va_arg(arg, int));
-                    break;
-
-                case 's':
-                    for (char* s = va_arg(arg, char*); *s; s++)
-                    {
-                        Term_PutChar(*s);
-                    }
-                    break;
-
-                case 'p':
-                case 'x':
-                    {
-                        uint64_t val = va_arg(arg, uint64_t);
-                        if (ndigits > 6u)
-                        {
-                            Term_PutHex64(val);
-                        }
-                        else if (ndigits > 4u)
-                        {
-                            Term_PutHex32(val);
-                        }
-                        else if (ndigits > 2u)
-                        {
-                            Term_PutHex16(val);
-                        }
-                        else
-                        {
-                            Term_PutHex8(val);
-                        }
-                        break;
-                    }
-
-                case '%':
-                    Term_PutChar('%');
-                    break;
-            }
-        }
-        else
-        {
-            Term_PutChar(*fmt);
-        }
-    }
-    va_end (arg);
-}
-
-void Term_PutString(char* s)
-{
-    for (; *s; s++)
-    {
-        Term_PutChar(*s);
-    }
-}
-
-static void PutDigits(uint64_t val, uintptr_t base)
-{
-    char buf[64] = {0};
-    int i = 62;
-
-    do
-    {
-        buf[i--] = Digits[val % base];
-        val /= base;
-    } while (val && i);
-
-    Term_PutString(&buf[i+1]);
-}
-
-void Term_PutInt(int64_t val)
-{
-    if (val < 0)
-    {
-        Term_PutChar('-');
-        val = -val;
-    }
-    PutDigits((uintptr_t)val, 10);
-}
-
-void Term_PutHex(uintptr_t val)
-{
-    PutDigits(val, 16);
-}
-
-void Term_PutHex8(uint8_t val)
-{
-    Term_PutString((char[]){
-        Digits[(val >> 4) & 0xF],
-        Digits[val & 0xF],
-        0
-    });
-}
-
-void Term_PutHex16(uint16_t val)
-{
-    Term_PutString((char[]){
-        Digits[(val >> 12) & 0xF],
-        Digits[(val >> 8) & 0xF],
-        Digits[(val >> 4) & 0xF],
-        Digits[val & 0xF],
-        0
-    });
-}
-
-void Term_PutHex32(uint32_t val)
-{
-    Term_PutString((char[]){
-        Digits[(val >> 28) & 0xF],
-        Digits[(val >> 24) & 0xF],
-        Digits[(val >> 20) & 0xF],
-        Digits[(val >> 16) & 0xF],
-        Digits[(val >> 12) & 0xF],
-        Digits[(val >> 8) & 0xF],
-        Digits[(val >> 4) & 0xF],
-        Digits[val & 0xF],
-        0
-    });
-}
-
-void Term_PutHex64(uint64_t val)
-{
-    Term_PutString((char[]){
-        Digits[(val >> 60) & 0xF],
-        Digits[(val >> 56) & 0xF],
-        Digits[(val >> 52) & 0xF],
-        Digits[(val >> 48) & 0xF],
-        Digits[(val >> 44) & 0xF],
-        Digits[(val >> 40) & 0xF],
-        Digits[(val >> 36) & 0xF],
-        Digits[(val >> 32) & 0xF],
-        Digits[(val >> 28) & 0xF],
-        Digits[(val >> 24) & 0xF],
-        Digits[(val >> 20) & 0xF],
-        Digits[(val >> 16) & 0xF],
-        Digits[(val >> 12) & 0xF],
-        Digits[(val >> 8) & 0xF],
-        Digits[(val >> 4) & 0xF],
-        Digits[val & 0xF],
-        0
-    });
-}
-
-void Term_PutNewline(void)
-{
-    Term_PutChar('\n');
-}
diff --git a/core/video.c b/core/video.c
deleted file mode 100644 (file)
index 581f5ac..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <platform.h>
-
index 188a800c975c31d25ec74adbd9c61c1814aa819d..b61737dded6a2c14a07f8a8c970f7db70ceaafe5 100644 (file)
@@ -1,87 +1,34 @@
-#include <platform.h>
+#include <stdint.h>
 #include <uefi.h>
 
-/* this is implemented by the application */
-extern int main(void);
-
-/* globals to store system table pointers */
-static efi_handle_t IM = NULL;
-static efi_system_table_t *ST = NULL;
-static efi_boot_services_t *BS = NULL;
-static efi_runtime_services_t *RT = NULL;
-static efi_loaded_image_protocol_t *LIP = NULL;
-
-/* platform specific globals */
-VideoConfig Video;
-MemoryMap Map;
-
-//#define D(base, flags, access, base, limit) \
-//    (((base >> 24) << 56)   | \
-//     (flags << 52)  | \
-//     (limit << 48)  | \
-//     (access << 40) | \
-//     (base << 16)   | \
-//     (limit))
-
-uint64_t GDT[] = {
-    0u
-};
-
-void sleep(int ms)
-{
-    BS->Stall(ms * 1000);
-}
+void StartOnward(void);
 
-static void video_init(void)
-{
-    /* get a handle to the graphics protocol */
-    efi_gop_t *gop = NULL;
-    efi_guid_t gopGuid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
-    BS->LocateProtocol(&gopGuid, NULL, (void**)&gop);
-
-    /* query mode 0 to see if mode needs to be set first */
-    uintn_t info_size = 0;
-    efi_gop_mode_info_t *info = NULL;
-    uintn_t status = gop->QueryMode(gop, 0, &info_size, &info);
-
-    /* some machines need mode set explicitly first */
-    if (status == EFI_NOT_STARTED)
-    {
-        status = gop->SetMode(gop, 0);
-    }
+struct {
+    efi_handle_t IM;
+    efi_system_table_t* ST;
+    efi_boot_services_t* BS;
+} EFI = {0};
 
-    /*
-        OK, now we have real info for possible modes, pick the max mode.
-        We assume this one is the best resolution.
-    */
-    if (status == EFI_SUCCESS)
-    {
-        status = gop->SetMode(gop, 17); /* pick a smaller resolution for QEMU */
-//        status = gop->SetMode(gop, gop->Mode->MaxMode-1);
-    }
 
-    /*
-        Now let's save off the info we need to draw pixels and glyphs.
-        The code in this file assumes 32 bits per pixel.
-    */
-    Video.buffer = (uint32_t*)(gop->Mode->FrameBufferBase);
-    Video.stride = gop->Mode->Information->PixelsPerScanLine;
-    Video.width = gop->Mode->Information->HorizontalResolution;
-    Video.height = gop->Mode->Information->VerticalResolution;
+long GetChar(void)
+{
+    efi_input_key_t key = {0};
+    efi_status_t status;
+    do {
+        status = EFI.ST->ConIn->ReadKeyStroke(EFI.ST->ConIn, &key);
+    } while(status != EFI_SUCCESS);
+    return key.UnicodeChar;
 }
 
-static void memory_init(void)
+void PutChar(long c)
 {
-    efi_status_t status = 0;
-
-    /* get the map size */
-    status = BS->GetMemoryMap(
-        &Map.size, (efi_memory_descriptor_t*)Map.data, &Map.key, &Map.desc_size, &Map.desc_ver);
-    /* get the map for real now */
-    (void)BS->AllocatePool(
-        EfiBootServicesData, Map.size + 2 * Map.desc_size, (void**)&Map.data);
-    status = BS->GetMemoryMap(
-        &Map.size, (efi_memory_descriptor_t*)Map.data, &Map.key, &Map.desc_size, &Map.desc_ver);
+    wchar_t data[3] = {c,0,0};
+    if (c == '\n' || c == '\r')
+    {
+        data[0] = '\r';
+        data[1] = '\n';
+    }
+    EFI.ST->ConOut->OutputString(EFI.ST->ConOut, data);
 }
 
 /*
@@ -115,44 +62,36 @@ static void memory_init(void)
  */
 
 /* definitions for elf relocations */
-typedef uint64_t Elf64_Xword;
-typedef        int64_t  Elf64_Sxword;
-typedef uint64_t Elf64_Addr;
 typedef struct
 {
-  Elf64_Sxword  d_tag;              /* Dynamic entry type */
-  union
-    {
-      Elf64_Xword d_val;            /* Integer value */
-      Elf64_Addr d_ptr;             /* Address value */
-    } d_un;
+  int64_t  tag;            /* Dynamic entry type */
+  uint64_t value;          /* Integer or Address value */
 } Elf64_Dyn;
-#define DT_NULL             0       /* Marks end of dynamic section */
-#define DT_RELA             7       /* Address of Rela relocs */
-#define DT_RELASZ           8       /* Total size of Rela relocs */
-#define DT_RELAENT          9       /* Size of one Rela reloc */
+#define DT_NULL    0       /* Marks end of dynamic section */
+#define DT_RELA    7       /* Address of Rela relocs */
+#define DT_RELASZ  8       /* Total size of Rela relocs */
+#define DT_RELAENT 9       /* Size of one Rela reloc */
 typedef struct
 {
-  Elf64_Addr    r_offset;           /* Address */
-  Elf64_Xword   r_info;             /* Relocation type and symbol index */
+  uint64_t   r_offset;     /* Address */
+  uint64_t   r_info;       /* Relocation type and symbol index */
 } Elf64_Rel;
-#define ELF64_R_TYPE(i)     ((i) & 0xffffffff)
-#define R_X86_64_RELATIVE   8       /* Adjust by program base */
+#define ELF64_R_TYPE(i)    ((i) & 0xffffffff)
+#define R_X86_64_RELATIVE  8       /* Adjust by program base */
 
 int uefi_init(uintptr_t ldbase, Elf64_Dyn *dyn, efi_system_table_t *systab, efi_handle_t image)
 {
-    efi_guid_t lipGuid = EFI_LOADED_IMAGE_PROTOCOL_GUID;
     efi_status_t status;
-
     long relsz = 0, relent = 0;
     Elf64_Rel *rel = 0;
     uintptr_t *addr;
+
     /* handle relocations */
-    for (int i = 0; dyn[i].d_tag != DT_NULL; ++i) {
-        switch (dyn[i].d_tag) {
-            case DT_RELA: rel = (Elf64_Rel*)((unsigned long)dyn[i].d_un.d_ptr + ldbase); break;
-            case DT_RELASZ: relsz = dyn[i].d_un.d_val; break;
-            case DT_RELAENT: relent = dyn[i].d_un.d_val; break;
+    for (int i = 0; dyn[i].tag != DT_NULL; ++i) {
+        switch (dyn[i].tag) {
+            case DT_RELA:    rel = (Elf64_Rel*)((unsigned long)dyn[i].value + ldbase); break;
+            case DT_RELASZ:  relsz = dyn[i].value; break;
+            case DT_RELAENT: relent = dyn[i].value; break;
             default: break;
         }
     }
@@ -176,29 +115,21 @@ int uefi_init(uintptr_t ldbase, Elf64_Dyn *dyn, efi_system_table_t *systab, efi_
     );
 
     /* save EFI pointers and loaded image into globals */
-    IM = image;
-    ST = systab;
-    BS = systab->BootServices;
-    RT = systab->RuntimeServices;
-    BS->HandleProtocol(image, &lipGuid, (void **)&LIP);
-
-    /* perform some initialization for the kernel */
-    video_init();
-    memory_init();
-
-    /* exit boot services now */
-    status = BS->ExitBootServices(IM, Map.key);
-
-    /* initialize the TSS */
-    /* initialize the IDT */
-    /* initialize the paging tables */
-    /* initialize the heap allocator */
-    /* initialize system calls */
-    /* initialize the realtime clock */
-    /* initialize the global timer */
-
-    /* now jump to kernel main() */
-    return main();
+    EFI.IM = image;
+    EFI.ST = systab;
+    EFI.BS = systab->BootServices;
+
+    /* start the REPL */
+    EFI.ST->ConOut->ClearScreen(EFI.ST->ConOut);
+    EFI.ST->ConOut->EnableCursor(EFI.ST->ConOut, 1);
+    StartOnward();
+
+//    while(1)
+//    {
+//        PutChar(GetChar());
+//    }
+
+    return 0;
 }
 
 /* we only need one .o file, so use inline Assembly here */
diff --git a/uefi/onward.S b/uefi/onward.S
new file mode 100644 (file)
index 0000000..0fde90e
--- /dev/null
@@ -0,0 +1,253 @@
+//---------------------------------------------------------------------
+// TODO
+//---------------------------------------------------------------------
+/*
+*/
+
+//---------------------------------------------------------------------
+// Register Usage
+//---------------------------------------------------------------------
+// x86_64 Parameter Registers:
+//     rdi, rsi, rdx, rcx, r8, r9
+//
+// x86_64 Preserved Registers:
+//     rbx, rsp, rbp, r12, r13, r14, r15
+
+.set PC,  %rsi /* Program Counter */
+.set ASP, %rsp /* Argument Stack Pointer*/
+.set RSP, %rbp /* Return Stack Pointer */
+.set OA1, %rax /* Operator Argument Register 1 */
+.set OA2, %rbx /* Operator Argument Register 2 */
+
+//---------------------------------------------------------------------
+// Assembler Macros
+//---------------------------------------------------------------------
+
+// Execute next instruction
+.macro NEXT
+    lodsq
+    jmpq       *(OA1)
+.endm
+
+.macro PUSHRSP reg
+    leaq -8(%rbp),%rbp // push reg on to return stack
+    movq \reg,(%rbp)
+.endm
+
+.macro POPRSP reg
+    movq (%rbp),\reg    // pop top of return stack to reg
+    leaq 8(%rbp),%rbp
+.endm
+
+.macro defcode name, namelen, flags=0, label
+       .data
+       .p2align 4
+       .global name_\label
+name_\label :
+       .quad link
+       .set link, name_\label
+       .byte \flags+\namelen
+       .ascii "\name"
+       .p2align 4
+       .global \label
+\label :
+       .quad code_\label
+       .text
+       .p2align 4, 0x90
+       .global code_\label
+code_\label :
+.endm
+
+.macro defword name, namelen, flags=0, label
+       .data
+       .p2align 4
+       .global name_\label
+name_\label :
+       .quad link
+       .set link,name_\label
+       .byte \flags+\namelen
+       .ascii "\name"
+       .p2align 4
+       .globl \label
+\label :
+       .int DOCOL
+.endm
+
+//---------------------------------------------------------------------
+// Inner Interpreter Word
+//---------------------------------------------------------------------
+
+// Main Interpreter Definition
+    .text
+    .globl DOCOL
+    .p2align 4, 0x90
+DOCOL:
+    pushq   PC
+    leaq    8(OA1), PC
+    NEXT
+
+//---------------------------------------------------------------------
+// Builtin Primitives
+//---------------------------------------------------------------------
+//  Legend:
+//      i   Integer value
+//      f   Fixed point value
+//      F   Floating point value
+//      s   String value
+//      v   Any value
+
+// (i - ) Exit the application with status code
+defcode "halt",4,,halt
+    popq    %rdi
+    call    _exit
+
+// ( - v) Pushes an immediate value onto the stack
+defcode "lit",3,,lit
+    lodsq
+    pushq   OA1
+    NEXT
+
+// (v - )Duplicates the top value on the stack
+defcode "drop",4,,drop
+    popq   OA1
+    NEXT
+
+// (v1 v2 - v2 v1) Swap the top two values on the stack
+defcode "swap",4,,swap
+    popq   OA1
+    popq   OA2
+    pushq  OA2
+    pushq  OA1
+    NEXT
+
+// (v - v v) Duplicate the top value on the stack
+defcode "dup",3,,dup
+    movq   (ASP), OA1
+    pushq  OA1
+    NEXT
+
+// (v1 v2 - v1 v2 v1) Duplicate second item on the stack
+defcode "over",4,,over
+    movq   8(ASP), OA1
+    pushq  OA1
+    NEXT
+
+// defcode rot
+// defcode -rot
+// defcode 2drop
+// defcode 2dup
+// defcode 2swap
+// defcode ?dup
+
+// defcode 1+
+// defcode 1-
+// defcode 4+
+// defcode 4-
+// defcode 8+
+// defcode 8-
+
+// defcode +
+// defcode -
+// defcode *
+// defcode /
+// defcode %
+
+// defcode =
+// defcode !=
+// defcode <
+// defcode >
+// defcode <=
+// defcode >=
+
+// defcode 0=
+// defcode 0!=
+// defcode 0<
+// defcode 0>
+// defcode 0<=
+// defcode 0>=
+
+// defcode and
+// defcode or
+// defcode xor
+// defcode not
+
+
+// defcode ret
+
+
+// defcode !
+// defcode @
+// defcode +!
+// defcode -!
+// defcode b!
+// defcode b@
+// defcode b@b!
+// defcode bmove
+
+
+// defcode >r
+// defcode r>
+// defcode rsp@
+// defcode rsp!
+// defcode rdrop
+
+// defcode asp@
+// defcode asp!
+
+// defcode getc
+// defcode putc
+// defcode word
+// defcode number
+// defcode find
+// defcode >cfa
+// defcode >dfa
+// defcode create
+// defcode ,
+// defcode [
+// defcode ]
+// defcode :
+// defcode ;
+// defcode immediate
+// defcode hidden
+// defcode hide
+// defcode '
+
+// defcode branch
+// defcode 0branch
+// defcode litstring
+// defcode tell
+// defcode quit
+// defcode interpret
+
+// defcode char
+// defcode execute
+// defcode syscall // or EFI call
+
+// Floating point operations
+// defcode +.
+// defcode -.
+// defcode *.
+// defcode /.
+
+//---------------------------------------------------------------------
+// Main Routine
+//---------------------------------------------------------------------
+    .text
+    .global StartOnward
+    .p2align 4, 0x90
+StartOnward:
+    pushq   OA1
+    pushq   %rbp
+    leaq    cold_start(%rip), PC
+    NEXT
+
+// First instructions to execute by the interpreter
+    .data
+    .global cold_start
+    .p2align 4
+cold_start:
+    .quad   lit, 42
+    .quad   lit, 24
+    .quad   over
+    .quad   halt
+//    .quad   QUIT
index b4b599bbeda52afab4abe02496720158d911b6aa..9e7eb2d85defb8aa75ed467a7d3003cc9540669c 100644 (file)
@@ -1,57 +1,3 @@
-/* define standard type definitions */
-typedef char                int8_t;
-typedef unsigned char       uint8_t;
-typedef short               int16_t;
-typedef unsigned short      uint16_t;
-typedef int                 int32_t;
-typedef unsigned int        uint32_t;
-typedef long long           int64_t;
-typedef unsigned long long  uint64_t;
-typedef long long           intptr_t;
-typedef unsigned long long  uintptr_t;
-
-/* sanity check type definitions */
-extern char check_u16[sizeof(uint16_t) == 2  ? 1 : -1];
-extern char check_u32[sizeof(uint32_t) == 4  ? 1 : -1];
-extern char check_u64[sizeof(uint64_t) == 8  ? 1 : -1];
-extern char check_uptr[sizeof(uintptr_t) == 8 ? 1 : -1];
-
-#define NULL     ((void*)0)
-#define abs(x)   ((x)<0?-(x):(x))
-#define min(x,y) ((x)<(y)?(x):(y))
-#define max(x,y) ((x)>(y)?(x):(y))
-
-typedef __builtin_va_list va_list;
-#define va_start(v,l)   __builtin_va_start(v,l)
-#define va_end(v)       __builtin_va_end(v)
-#define va_arg(v,l)     __builtin_va_arg(v,l)
-
-/* video memory configuration info */
-typedef struct {
-    uint32_t* buffer;
-    uint32_t stride;
-    uint32_t width;
-    uint32_t height;
-} VideoConfig;
-
-typedef struct {
-    uint32_t type;
-    uint32_t pad;
-    uint64_t phys_start;
-    uint64_t virt_start;
-    uint64_t npages;
-    uint64_t attr;
-} MemoryDescriptor;
-
-typedef struct {
-    MemoryDescriptor* data;
-    uint64_t size;
-    uint64_t key;
-    uint64_t desc_size;
-    uint32_t desc_ver;
-} MemoryMap;
-
-extern MemoryMap Map;
-extern VideoConfig Video;
-
-void sleep(int ms);
+void sleep(long ms);
+long getchar(void);
+void putchar(long c);