diff --git a/setup.sh b/setup.sh index 3ab7645..f8b8443 100755 --- a/setup.sh +++ b/setup.sh @@ -7,10 +7,14 @@ if [ -x "$(command -v curl)" ]; then curl -s -o libBareMetal.asm https://raw.githubusercontent.com/ReturnInfinity/BareMetal/master/api/libBareMetal.asm curl -s -o libBareMetal.c https://raw.githubusercontent.com/ReturnInfinity/BareMetal/master/api/libBareMetal.c curl -s -o libBareMetal.h https://raw.githubusercontent.com/ReturnInfinity/BareMetal/master/api/libBareMetal.h + curl -s -o lib-ui.asm https://raw.githubusercontent.com/ReturnInfinity/BareMetal-Monitor/master/api/lib-ui.asm + curl -s -o lib-ui.h https://raw.githubusercontent.com/ReturnInfinity/BareMetal-Monitor/master/api/lib-ui.h else wget -q https://raw.githubusercontent.com/ReturnInfinity/BareMetal/master/api/libBareMetal.asm wget -q https://raw.githubusercontent.com/ReturnInfinity/BareMetal/master/api/libBareMetal.c wget -q https://raw.githubusercontent.com/ReturnInfinity/BareMetal/master/api/libBareMetal.h + wget -q https://raw.githubusercontent.com/ReturnInfinity/BareMetal-Monitor/master/api/lib-ui.asm + wget -q https://raw.githubusercontent.com/ReturnInfinity/BareMetal-Monitor/master/api/lib-ui.h fi cd .. diff --git a/src/uitest.asm b/src/uitest.asm index 089d811..9e37eb1 100644 --- a/src/uitest.asm +++ b/src/uitest.asm @@ -4,6 +4,7 @@ [BITS 64] %INCLUDE "libBareMetal.asm" +%INCLUDE "lib-ui.asm" b_user equ 0x0000000000100048 @@ -13,8 +14,8 @@ start: ; Start of program label call [b_output] ; Print the string that RSI points to mov eax, 0x00FF0000 ; Red - mov cl, 0x11 - call [b_user] + mov cl, SET_FG + call [b_user] ; b_user is set entry point of ui_api lea rsi, [rel test_message] ; Load RSI with the relative memory address of string mov ecx, 4 ; Output 14 characters call [b_output] ; Print the string that RSI points to @@ -24,7 +25,7 @@ start: ; Start of program label call [b_output] ; Print the string that RSI points to mov eax, 0x0000FF00 ; Green - mov cl, 0x11 + mov cl, SET_FG call [b_user] lea rsi, [rel test_message] ; Load RSI with the relative memory address of string mov ecx, 4 ; Output 14 characters @@ -35,23 +36,23 @@ start: ; Start of program label call [b_output] ; Print the string that RSI points to mov eax, 0x000000FF ; Blue - mov cl, 0x11 + mov cl, SET_FG call [b_user] lea rsi, [rel test_message] ; Load RSI with the relative memory address of string mov ecx, 4 ; Output 14 characters call [b_output] ; Print the string that RSI points to mov eax, 0x00FF00FF - mov cl, 0x11 + mov cl, SET_FG call [b_user] mov eax, 0x0000FF00 ; Green - mov cl, 0x12 + mov cl, SET_BG call [b_user] mov ax, 20 - mov cl, 0x13 + mov cl, SET_CURSOR_ROW call [b_user] mov ax, 10 - mov cl, 0x14 + mov cl, SET_CURSOR_COL call [b_user] lea rsi, [rel test_message] ; Load RSI with the relative memory address of string mov ecx, 4 ; Output 14 characters