|
|
@ -1,5 +1,5 @@ |
|
|
|
BITS 16 |
|
|
|
start_sing_os: |
|
|
|
start_sing: |
|
|
|
; loading essentials for SingOS to run |
|
|
|
|
|
|
|
; VSFS is loaded: |
|
|
@ -8,7 +8,7 @@ start_sing_os: |
|
|
|
; SingOS is ready for the user: |
|
|
|
|
|
|
|
mov si, welcome ; Put address of the null-terminated string to output into 'si' |
|
|
|
call print_os ; Call our string-printing routine |
|
|
|
call print ; Call our string-printing routine |
|
|
|
|
|
|
|
mov si, number_one_zstring |
|
|
|
call zstring_to_integer |
|
|
@ -16,14 +16,14 @@ start_sing_os: |
|
|
|
|
|
|
|
|
|
|
|
mov si, command_line |
|
|
|
call print_os |
|
|
|
call print |
|
|
|
jmp terminal |
|
|
|
|
|
|
|
terminal: |
|
|
|
call wait_for_key_os |
|
|
|
call wait_for_key |
|
|
|
jmp terminal |
|
|
|
|
|
|
|
wait_for_key_os: |
|
|
|
wait_for_key: |
|
|
|
pusha |
|
|
|
|
|
|
|
mov ax, 0 |
|
|
@ -71,7 +71,7 @@ wait_for_key_os: |
|
|
|
|
|
|
|
.os_buffer_full: |
|
|
|
mov si, .os_str_full |
|
|
|
call print_os |
|
|
|
call print |
|
|
|
popa |
|
|
|
ret |
|
|
|
|
|
|
@ -117,7 +117,7 @@ wait_for_key_os: |
|
|
|
|
|
|
|
.no_str: |
|
|
|
mov si, command_line |
|
|
|
call print_os |
|
|
|
call print |
|
|
|
jmp .return_enter |
|
|
|
|
|
|
|
.compare_with_LIST_searchindex dw 0 |
|
|
@ -132,7 +132,7 @@ wait_for_key_os: |
|
|
|
|
|
|
|
.end: |
|
|
|
mov si, exit_message |
|
|
|
call print_os |
|
|
|
call print |
|
|
|
|
|
|
|
call power_off |
|
|
|
|
|
|
@ -178,30 +178,30 @@ wait_for_key_os: |
|
|
|
mov bx, [.os_command_buffer_counter] |
|
|
|
cmp bx, 0x00 |
|
|
|
je near .no_str ; First byte is 0 => No command |
|
|
|
call printCRLF_os |
|
|
|
call printCRLF |
|
|
|
add bx, .os_command_buffer ; Note addition. Sets bx to the end of the string, which should be guaranteed to be 0 |
|
|
|
mov ax, 0x00 |
|
|
|
mov [bx], ax ; Ensure that the command is null-terminated |
|
|
|
xor bx, bx |
|
|
|
mov [.os_command_buffer_counter], bx |
|
|
|
mov si, .os_command_buffer |
|
|
|
call print_os ; Echo the command |
|
|
|
call print ; Echo the command |
|
|
|
|
|
|
|
lea si, [.os_command_buffer] |
|
|
|
;mov dword [.compare_with_LIST_searchindex], 0 ; Next time, start at 0 |
|
|
|
mov cx, 0 ; Index |
|
|
|
|
|
|
|
.command_interpreter_searchloop: |
|
|
|
;call printCRLF_os |
|
|
|
;call printCRLF |
|
|
|
;mov ax, cx |
|
|
|
;call dumpax_os |
|
|
|
;call dumpax |
|
|
|
;mov bx, [.compare_with_LIST_searchindex] |
|
|
|
mov bx, cx |
|
|
|
add bx, bx ; The pointers are 2 bytes long. Compensate here |
|
|
|
|
|
|
|
;call printCRLF_os |
|
|
|
;call printCRLF |
|
|
|
;mov ax, cx |
|
|
|
;call dumpax_os |
|
|
|
;call dumpax |
|
|
|
|
|
|
|
mov dx, [.compare_with_LIST_NAMES+bx] ; Here it HAS to be bx. Otherwise it is invalid for some reason |
|
|
|
mov bx, dx |
|
|
@ -229,21 +229,21 @@ wait_for_key_os: |
|
|
|
jmp .no_str |
|
|
|
|
|
|
|
.command_interpreter_foundcommand: |
|
|
|
call printCRLF_os |
|
|
|
call printCRLF |
|
|
|
|
|
|
|
;mov bx, [.compare_with_LIST_searchindex] ; Remember this thing |
|
|
|
mov bx, cx |
|
|
|
add bx, bx ;The pointers are 2 bytes long. Compensate here |
|
|
|
|
|
|
|
;call printCRLF_os |
|
|
|
;call printCRLF |
|
|
|
;mov ax, cx |
|
|
|
;call dumpax_os |
|
|
|
;call dumpax |
|
|
|
|
|
|
|
mov dx, [.compare_with_LIST_POINTERS+bx] ; This is where the program is. |
|
|
|
|
|
|
|
;mov ax, dx |
|
|
|
;call printCRLF_os |
|
|
|
;call dumpax_os |
|
|
|
;call printCRLF |
|
|
|
;call dumpax |
|
|
|
|
|
|
|
call dx |
|
|
|
|
|
|
@ -251,7 +251,7 @@ wait_for_key_os: |
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
global_vars_os: |
|
|
|
global_vars: |
|
|
|
global_vsfs_master_record dw 8 ; this is the index of the start of the master table for the filesystem |
|
|
|
; This should maby contain more information. |
|
|
|
; and somehow be setted in a fix sector, which holds all the variabels for SingOS |
|
|
@ -262,7 +262,7 @@ global_vars_os: |
|
|
|
; Changed my mind, the index is currently loaded and written back to disk under |
|
|
|
; creation of a new file. |
|
|
|
|
|
|
|
data_os: |
|
|
|
data: |
|
|
|
welcome db 'This is SingOS! v0.0.3', 13, 10, 'Press ESC to halt.', 13, 10, 0 |
|
|
|
exit_message db 13, 10, 'Goodbye from SingOS',13,10,'The system has halted.', 0 |
|
|
|
command_line db 13, 10, 'groot@SingOS $ ', 0 |
|
|
@ -271,8 +271,7 @@ data_os: |
|
|
|
%include "mem_lib/mem_lib.nasm" |
|
|
|
%include "lib/os_lib.nasm" |
|
|
|
%include "lib/string.nasm" |
|
|
|
%include "lib/dumpmem.nasm" |
|
|
|
%include "lib/printkey.nasm" |
|
|
|
%include "lib/debug_tools.nasm" |
|
|
|
%include "lib/std_power.nasm" |
|
|
|
%include "lib/svim.nasm" |
|
|
|
%include "vsfs/vsfs.nasm" |
|
|
@ -280,4 +279,4 @@ data_os: |
|
|
|
|
|
|
|
;times 131072-($-$$) db 0 ; 256 sectos |
|
|
|
;GLOBAL_VSFS_START db 'VSFS v0.1' ; sector 257 reserved for file system information |
|
|
|
times 1048576-($-$$) db 0 ; sector 258 to sector 2048 should be avaliable to the filesystem. |
|
|
|
times (1<<20)-($-$$) db 0 ; sector 258 to sector 2048 should be avaliable to the filesystem. |