diff --git a/src/drivers/bus/xhci.asm b/src/drivers/bus/xhci.asm index e6fd3d6..ea743b4 100644 --- a/src/drivers/bus/xhci.asm +++ b/src/drivers/bus/xhci.asm @@ -177,7 +177,7 @@ xhci_init_msix_msi_done: ; Check for a valid version number shr eax, 16 ; 16-bit version is in bits 31:16, shift to 15:0 cmp ax, 0x0100 ; Verify it is at least v1.0 - jl xhci_init_error + jb xhci_init_error mov eax, [rsi+xHCI_HCSPARAMS1] ; Gather MaxSlots (bits 7:0) and MaxPort (31:24) mov byte [xhci_maxslots], al rol eax, 8 @@ -1561,7 +1561,7 @@ xhci_check_command_event: load_event: call os_hpet_us cmp rax, rdx - jg xhci_check_command_event_timeout + ja xhci_check_command_event_timeout mov rax, [rsi] cmp rax, 0 jne compare diff --git a/src/drivers/ioapic.asm b/src/drivers/ioapic.asm index dde1adc..cfed771 100644 --- a/src/drivers/ioapic.asm +++ b/src/drivers/ioapic.asm @@ -82,7 +82,7 @@ os_ioapic_redirection: and eax, 0x000000FF ; Clear the top 24 bits of EAX just in case mov cl, [os_ioapic_mde] ; Get the Maximum amount of Redirection Entries cmp al, cl ; Compare the Interrupt Vector to the MDE - jg os_ioapic_redirection_error ; If it is greater then bail out + ja os_ioapic_redirection_error ; If it is greater then bail out mov ecx, eax add eax, 0x20 ; Offset to start of Interrupts push rcx diff --git a/src/drivers/lfb/lfb.asm b/src/drivers/lfb/lfb.asm index eaaf75e..f0b47ae 100644 --- a/src/drivers/lfb/lfb.asm +++ b/src/drivers/lfb/lfb.asm @@ -185,7 +185,7 @@ lfb_output_chars_nextchar: dec rcx lodsb ; Get char from string and store in AL cmp al, 0x20 - jge lfb_output_chars_nextchar_output + jae lfb_output_chars_nextchar_output cmp al, 0x0A ; LF - Check if there was a newline (aka line feed) character in the string je lfb_output_chars_newline ; If so then we print a new line cmp al, 0x0D ; CR - Check if there was a carriage return character in the string @@ -338,9 +338,9 @@ lfb_glyph: ; Filter out characters that can't be displayed and eax, 0x000000FF ; Only keep AL cmp al, 0x20 - jl hidden + jb hidden cmp al, 127 - jg hidden + ja hidden sub rax, 0x20 jmp load_char hidden: diff --git a/src/drivers/nvs/ahci.asm b/src/drivers/nvs/ahci.asm index 3035547..3898a36 100644 --- a/src/drivers/nvs/ahci.asm +++ b/src/drivers/nvs/ahci.asm @@ -39,7 +39,7 @@ ahci_init: mov eax, [rsi+AHCI_VS] ror eax, 16 ; Rotate EAX so MJR is bits 15:00 cmp al, 0x01 - jl ahci_init_error + jb ahci_init_error mov [os_AHCI_MJR], al rol eax, 8 ; Rotate EAX so MNR is bits 07:00 mov [os_AHCI_MNR], al @@ -247,7 +247,7 @@ ahci_io_prep_next_drive: ahci_io_prep_good_drive_id: cmp rcx, 8192 ; Are we trying to read more that 4MiB? - jge achi_io_error ; If so, bail out + jae achi_io_error ; If so, bail out push rcx ; Save the sector count push rdi ; Save the destination memory address diff --git a/src/drivers/nvs/ata.asm b/src/drivers/nvs/ata.asm index a6a7ece..5196253 100644 --- a/src/drivers/nvs/ata.asm +++ b/src/drivers/nvs/ata.asm @@ -55,7 +55,7 @@ ata_io: ; A single request can read 128KiB cmp rcx, 256 - jg ata_io_fail ; Over 256? Fail! + ja ata_io_fail ; Over 256? Fail! ; TODO - Don't fail. Break the read into multiple requests jne ata_io_skip ; Not 256? No need to modify CL xor rcx, rcx ; 0 translates to 256 @@ -92,7 +92,7 @@ ata_io_wait: jne ata_io_dataready ata_io_retry: dec rcx - jg ata_io_wait + ja ata_io_wait ata_io_nextsector: in al, dx ; Read status from 0x01F7 test al, 0x80 ; BSY flag set? diff --git a/src/drivers/nvs/nvme.asm b/src/drivers/nvs/nvme.asm index e9b8f6d..0f62978 100644 --- a/src/drivers/nvs/nvme.asm +++ b/src/drivers/nvs/nvme.asm @@ -39,7 +39,7 @@ nvme_init: mov eax, [rsi+NVMe_VS] ror eax, 16 ; Rotate EAX so MJR is bits 15:00 cmp al, 0x01 - jl nvme_init_error + jb nvme_init_error mov [os_NVMeMJR], al rol eax, 8 ; Rotate EAX so MNR is bits 07:00 mov [os_NVMeMNR], al @@ -163,7 +163,7 @@ nvme_init_LBA_next: shr eax, 16 ; AL holds the LBADS mov bl, al ; BL holds the highest LBADS so far cmp al, bl - jle nvme_init_LBA_skip + jbe nvme_init_LBA_skip mov bl, al ; BL holds the highest LBADS so far nvme_init_LBA_skip: dec cl @@ -249,7 +249,7 @@ nvme_admin: mov ecx, eax ; Save the old Admin tail value for reading from the completion ring add al, 1 ; Add 1 to it cmp al, 64 ; Is it 64 or greater? - jl nvme_admin_savetail + jb nvme_admin_savetail xor eax, eax ; Is so, wrap around to 0 nvme_admin_savetail: mov [os_NVMe_atail], al ; Save the tail for the next command @@ -343,7 +343,7 @@ nvme_io_setup: ; For 8193+ bytes PRP2 points to a list of more PRPs push rcx ; Save the requested sector count for later cmp rcx, 2 - jle nvme_io_calc_rpr2_skip + jbe nvme_io_calc_rpr2_skip sub rcx, 1 ; Subtract one as PTR1 covers one 4K load push rdi mov rdi, os_nvme_rpr ; Space to build the RPR2 structure @@ -381,7 +381,7 @@ nvme_io_calc_rpr2_end: mov ecx, eax ; Save the old I/O tail value for reading from the completion ring add al, 1 ; Add 1 to it cmp al, 64 ; Is it 64 or greater? - jl nvme_io_savetail + jb nvme_io_savetail xor eax, eax ; Is so, wrap around to 0 nvme_io_savetail: mov [os_NVMe_iotail], al ; Save the tail for the next command diff --git a/src/drivers/ps2.asm b/src/drivers/ps2.asm index ae9d485..8dac5b4 100644 --- a/src/drivers/ps2.asm +++ b/src/drivers/ps2.asm @@ -240,7 +240,7 @@ mouse_skip_y_movement: cmp ax, 0xF000 ; Check if it wrapped around below 0 ja checkx_min ; If so jump to min cmp ax, bx ; Check X value against valid max pixel location - jle checkx_end ; If less or equal then mouse cursor is on screen + jbe checkx_end ; If less or equal then mouse cursor is on screen checkx_max: ; If greater then mouse cursor has moved off the right edge mov [os_ps2_mouse_x], bx ; Set the mouse X location to Screen X-1 jmp checkx_end @@ -255,7 +255,7 @@ checkx_end: cmp ax, 0xF000 ; Check if it wrapped around below 0 ja checky_min ; If so jump to min cmp ax, bx ; Check Y value against valid max pixel location - jle checky_end ; If less or equal then mouse cursor is on screen + jbe checky_end ; If less or equal then mouse cursor is on screen checky_max: ; If greater then mouse cursor has moved off the bottom edge mov [os_ps2_mouse_y], bx ; Set the mouse Y location to Screen Y-1 jmp checky_end diff --git a/src/syscalls/debug.asm b/src/syscalls/debug.asm index d95c1a5..15c4d93 100644 --- a/src/syscalls/debug.asm +++ b/src/syscalls/debug.asm @@ -36,7 +36,7 @@ os_debug_dump_al: shr al, 4 ; Shift the high 4 bits into the low 4, high bits cleared or al, '0' ; Add "0" cmp al, '9'+1 ; Digit? - jl os_debug_dump_al_h ; Yes, store it + jb os_debug_dump_al_h ; Yes, store it add al, 7 ; Add offset for character "A" os_debug_dump_al_h: mov [tchar+0], al ; Store first character @@ -44,7 +44,7 @@ os_debug_dump_al_h: and al, 0x0F ; Keep only the low 4 bits or al, '0' ; Add "0" cmp al, '9'+1 ; Digit? - jl os_debug_dump_al_l ; Yes, store it + jb os_debug_dump_al_l ; Yes, store it add al, 7 ; Add offset for character "A" os_debug_dump_al_l: mov [tchar+1], al ; Store second character diff --git a/src/syscalls/net.asm b/src/syscalls/net.asm index c27036d..3b33ef2 100644 --- a/src/syscalls/net.asm +++ b/src/syscalls/net.asm @@ -50,7 +50,7 @@ b_net_tx: b_net_tx_maxcheck: cmp rcx, 1522 ; Fail if more than 1522 bytes - jg b_net_tx_fail + ja b_net_tx_fail mov rax, os_NetLock ; Lock the net so only one send can happen at a time call b_smp_lock diff --git a/src/syscalls/smp.asm b/src/syscalls/smp.asm index 8e5bd61..5704cf0 100644 --- a/src/syscalls/smp.asm +++ b/src/syscalls/smp.asm @@ -189,7 +189,7 @@ b_smp_setflag: push rax cmp rcx, 4 ; If a value higher than 3 was chosen then bail out - jge b_smp_setflag_done + jae b_smp_setflag_done call b_smp_get_id ; Return APIC ID in RAX diff --git a/src/syscalls/system.asm b/src/syscalls/system.asm index 2123b1e..2881707 100644 --- a/src/syscalls/system.asm +++ b/src/syscalls/system.asm @@ -15,7 +15,7 @@ ; All other registers preserved b_system: cmp rcx, 0x80 - jge b_system_end + jae b_system_end ; Use CX register as an index to the function table ; To save memory, the functions are placed in 16-bit frames