changed informational strings
This commit is contained in:
@@ -114,8 +114,7 @@ ALIGN 4, db 0x90
|
|||||||
SearchFATDIR:
|
SearchFATDIR:
|
||||||
__CDECL16_ENTRY
|
__CDECL16_ENTRY
|
||||||
.file_lookup:
|
.file_lookup:
|
||||||
print_string SearchFATDIR_INFO_cstr
|
print_string SearchFATDIR_info
|
||||||
|
|
||||||
.load_first_dir:
|
.load_first_dir:
|
||||||
mov eax, dword [fat32_state + FAT32_State_t.curr_dir_cluster_32]
|
mov eax, dword [fat32_state + FAT32_State_t.curr_dir_cluster_32]
|
||||||
push dword eax ; cluster
|
push dword eax ; cluster
|
||||||
@@ -183,7 +182,7 @@ SearchFATDIR:
|
|||||||
jmp SearchFATDIR.empty_dir_entry
|
jmp SearchFATDIR.empty_dir_entry
|
||||||
|
|
||||||
.parse_dir:
|
.parse_dir:
|
||||||
print_string MaybeFound_Boot_INFO_cstr
|
print_string MaybeFound_Boot_info
|
||||||
.lfn_check:
|
.lfn_check:
|
||||||
; check for ATTR_READ_ONLY | ATTR_HIDDEN | ATTR_SYSTEM | ATTR_VOLUME_ID (0x0F) in offset 11
|
; check for ATTR_READ_ONLY | ATTR_HIDDEN | ATTR_SYSTEM | ATTR_VOLUME_ID (0x0F) in offset 11
|
||||||
; TODO: going to skip LFN for now, since all valid volumes will have SFN's
|
; TODO: going to skip LFN for now, since all valid volumes will have SFN's
|
||||||
@@ -219,7 +218,7 @@ ALIGN 4, db 0x90
|
|||||||
NextCluster:
|
NextCluster:
|
||||||
__CDECL16_ENTRY
|
__CDECL16_ENTRY
|
||||||
.func:
|
.func:
|
||||||
print_string NextFATCluster_INFO_cstr
|
print_string NextFATCluster_info
|
||||||
mov edx, dword [bp + 4]
|
mov edx, dword [bp + 4]
|
||||||
mov si, fat32_nc_data ; instead of push/pop and moving the data back
|
mov si, fat32_nc_data ; instead of push/pop and moving the data back
|
||||||
mov di, fat32_bpb ; load si & di then use xchg
|
mov di, fat32_bpb ; load si & di then use xchg
|
||||||
@@ -329,7 +328,7 @@ ALIGN 4, db 0x90
|
|||||||
ReadFATCluster:
|
ReadFATCluster:
|
||||||
__CDECL16_ENTRY
|
__CDECL16_ENTRY
|
||||||
.func:
|
.func:
|
||||||
print_string ReadFATCluster_INFO_cstr
|
print_string ReadFATCluster_info
|
||||||
|
|
||||||
mov bx, word [boot_drive_ptr]
|
mov bx, word [boot_drive_ptr]
|
||||||
movzx ax, byte [ds:bx]
|
movzx ax, byte [ds:bx]
|
||||||
|
|||||||
@@ -135,8 +135,8 @@ main:
|
|||||||
|
|
||||||
mov byte [bp - 2], dl ; boot_drive (probably 0x80)
|
mov byte [bp - 2], dl ; boot_drive (probably 0x80)
|
||||||
mov word [bp - 4], si ; partition_offset
|
mov word [bp - 4], si ; partition_offset
|
||||||
mov word [bp - 6], bx ; partition_table
|
mov word [bp - 6], bx ; partition_table_vbr
|
||||||
mov word [bp - 8], dx ; fat32_bpb
|
mov word [bp - 8], dx ; fat32_bpb_vbr
|
||||||
.check_sig:
|
.check_sig:
|
||||||
mov eax, dword [STAGE2_SIG]
|
mov eax, dword [STAGE2_SIG]
|
||||||
cmp eax, 0xDEADBEEF
|
cmp eax, 0xDEADBEEF
|
||||||
@@ -163,35 +163,35 @@ main:
|
|||||||
|
|
||||||
call SetTextMode
|
call SetTextMode
|
||||||
call disable_cursor
|
call disable_cursor
|
||||||
print_string HelloPrompt_cstr
|
print_string HelloPrompt_info
|
||||||
|
|
||||||
; enable A20 gate
|
; enable A20 gate
|
||||||
call EnableA20
|
call EnableA20
|
||||||
print_string A20_Enabled_OK_cstr
|
print_string A20_Enabled_OK_info
|
||||||
|
|
||||||
; enter unreal mode
|
; enter unreal mode
|
||||||
call EnterUnrealMode
|
call EnterUnrealMode
|
||||||
print_string UnrealMode_OK_cstr
|
print_string UnrealMode_OK_info
|
||||||
|
|
||||||
; get system memory map
|
; get system memory map
|
||||||
call GetMemoryMap
|
call GetMemoryMap
|
||||||
print_string MemoryMap_OK_cstr
|
print_string MemoryMap_OK_info
|
||||||
|
|
||||||
; FAT Driver setup
|
; FAT Driver setup
|
||||||
call InitFATDriver
|
call InitFATDriver
|
||||||
print_string InitFATSYS_OK_cstr
|
print_string InitFATSYS_OK_info
|
||||||
|
|
||||||
;
|
;
|
||||||
; Find first cluster of bootable file
|
; Find first cluster of bootable file
|
||||||
call SearchFATDIR
|
call SearchFATDIR
|
||||||
push dword eax ; save first cluster of bootable file
|
push dword eax ; save first cluster of bootable file
|
||||||
|
|
||||||
print_string FileFound_OK_cstr
|
print_string FileFound_OK_info
|
||||||
|
|
||||||
pop dword eax
|
pop dword eax
|
||||||
push dword eax ; print Cluster of boot file
|
push dword eax ; print Cluster of boot file
|
||||||
call PrintDWORD ; void PrintDWORD(uint32_t dword)
|
call PrintDWORD ; void PrintDWORD(uint32_t dword)
|
||||||
print_string NewLine_cstr
|
print_string NewLine_info
|
||||||
|
|
||||||
; TODO: using first cluster information, start loading the kernel to memory
|
; TODO: using first cluster information, start loading the kernel to memory
|
||||||
; TODO: going to need an elf parser, some unreal mode file buffer functions to move the data
|
; TODO: going to need an elf parser, some unreal mode file buffer functions to move the data
|
||||||
@@ -261,7 +261,7 @@ ALIGN 4, db 0x90
|
|||||||
PrintDWORD:
|
PrintDWORD:
|
||||||
__CDECL16_ENTRY
|
__CDECL16_ENTRY
|
||||||
.func:
|
.func:
|
||||||
lea si, [IntToHex_table]
|
mov si, IntToHex_table
|
||||||
mov ebx, 16 ; base-16
|
mov ebx, 16 ; base-16
|
||||||
|
|
||||||
mov eax, dword [bp + 4] ;val
|
mov eax, dword [bp + 4] ;val
|
||||||
@@ -375,39 +375,43 @@ begin_data:
|
|||||||
;
|
;
|
||||||
; #############
|
; #############
|
||||||
|
|
||||||
%macro define_str 2
|
%macro define_cstr 2
|
||||||
ALIGN 16
|
ALIGN 16
|
||||||
%1_str:
|
%1_cstr:
|
||||||
db %2
|
db %2, 00h
|
||||||
%define str_len %strlen(%2) ; string
|
%define str_len %strlen(%2) ; string
|
||||||
%1_str_len:
|
%1_cstr_len:
|
||||||
dd str_len
|
dw str_len
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
; TODO: technically this is a cstr but it splices a return and newline on the end
|
; TODO: technically this is a cstr but it splices a return and newline on the end
|
||||||
; TODO: this probably should be seperated out and the printing functionality should
|
; TODO: this probably should be seperated out and the printing functionality should
|
||||||
; TODO: place that newline and return
|
; TODO: place that newline and return
|
||||||
%macro define_cstr 2
|
%macro define_info 2
|
||||||
%define CRLF_NUL 0Dh, 0Ah, 00h
|
%define CRLF_NUL 0Dh, 0Ah, 00h
|
||||||
ALIGN 16
|
ALIGN 16
|
||||||
%1_cstr:
|
%1_info:
|
||||||
db %2, CRLF_NUL
|
db %2, CRLF_NUL
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
define_cstr HelloPrompt, "Hello from Stevia Stage2!"
|
define_info HelloPrompt, "Hello from Stevia Stage2!"
|
||||||
define_cstr A20_Enabled_OK, "A20 Enabled OK"
|
define_info A20_Enabled_OK, "A20 Enabled OK"
|
||||||
define_cstr MemoryMap_OK, "Memory map OK"
|
define_info MemoryMap_OK, "Memory map OK"
|
||||||
define_cstr UnrealMode_OK, "Unreal mode OK"
|
define_info UnrealMode_OK, "Unreal mode OK"
|
||||||
define_cstr FileFound_OK, "Found SFN entry for bootable binary, first cluster -> "
|
define_info FileFound_OK, "Found SFN entry for bootable binary, first cluster -> "
|
||||||
define_cstr InitFATSYS_OK, "FAT32 Driver Init..."
|
define_info InitFATSYS_OK, "FAT32 Driver Init..."
|
||||||
|
|
||||||
define_cstr SearchFATDIR_INFO, "Searching FAT DIR for bootable file..."
|
define_info SearchFATDIR, "Searching FAT DIR for bootable file..."
|
||||||
define_cstr NextFATCluster_INFO, "Attempting to find next FAT cluster..."
|
define_info NextFATCluster, "Attempting to find next FAT cluster..."
|
||||||
define_cstr ReadFATCluster_INFO, "Attempting to load next FAT"
|
define_info ReadFATCluster, "Attempting to load next FAT"
|
||||||
define_cstr MaybeFound_Boot_INFO, "Maybe found a file...checking..."
|
define_info MaybeFound_Boot, "Maybe found a file...checking..."
|
||||||
define_cstr NewLine, ""
|
define_info NewLine, ""
|
||||||
|
|
||||||
define_str BootTarget, "BOOT BIN"
|
define_cstr BootTarget, "BOOT BIN"
|
||||||
|
|
||||||
|
ALIGN 16, db 0
|
||||||
|
BootTarget_str:
|
||||||
|
db 'BOOT BIN'
|
||||||
|
|
||||||
ALIGN 16
|
ALIGN 16
|
||||||
IntToHex_table:
|
IntToHex_table:
|
||||||
|
|||||||
Reference in New Issue
Block a user