From 42e91e7556949e46578c732c56d62d08d227bd83 Mon Sep 17 00:00:00 2001 From: isoux Date: Thu, 28 Nov 2024 00:06:38 +0200 Subject: [PATCH 1/2] Update to lib-ui --- setup.sh | 4 ++++ src/uitest.asm | 17 +++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/setup.sh b/setup.sh index 3ab7645..6853a9b 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 libBareMetal.asm https://raw.githubusercontent.com/ReturnInfinity/BareMetal-Monitor/master/api/lib-ui.asm + curl -s -o libBareMetal.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 From 688faf206436634edb963db02bf740276f257f8c Mon Sep 17 00:00:00 2001 From: isoux Date: Thu, 28 Nov 2024 19:19:22 +0200 Subject: [PATCH 2/2] Update --- setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 6853a9b..f8b8443 100755 --- a/setup.sh +++ b/setup.sh @@ -7,8 +7,8 @@ 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 libBareMetal.asm https://raw.githubusercontent.com/ReturnInfinity/BareMetal-Monitor/master/api/lib-ui.asm - curl -s -o libBareMetal.h https://raw.githubusercontent.com/ReturnInfinity/BareMetal-Monitor/master/api/lib-ui.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