Skip to content

Commit c7985f4

Browse files
author
Ian Seyler
committed
Continuation
1 parent 8b04142 commit c7985f4

File tree

10 files changed

+53
-53
lines changed

10 files changed

+53
-53
lines changed

src/drivers/bus/xhci.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ xhci_reset_halt:
273273
jnc xhci_reset_halt_done ; If the bit was clear, proceed onward
274274
btr eax, 0 ; Clear RS (bit 0)
275275
mov [rsi+xHCI_USBCMD], eax ; Write updated Command Register value
276-
mov rax, 20000 ; Wait 20ms (20000µs)
276+
mov eax, 20000 ; Wait 20ms (20000µs)
277277
call b_delay
278278
mov eax, [rsi+xHCI_USBSTS] ; Read Status Register
279279
bt eax, 0 ; Check HCHalted (bit 0) - it should be 1
@@ -291,7 +291,7 @@ xhci_reset_reset:
291291
mov eax, [rsi+xHCI_USBCMD] ; Read current Command Register value
292292
bts eax, 1 ; Set HCRST (bit 1)
293293
mov [rsi+xHCI_USBCMD], eax ; Write updated Command Register value
294-
mov rax, 100000 ; Wait 100ms (100000µs)
294+
mov eax, 100000 ; Wait 100ms (100000µs)
295295
call b_delay
296296
mov eax, [rsi+xHCI_USBSTS] ; Read Status Register
297297
bt eax, 11 ; Check CNR (bit 11)
@@ -464,7 +464,7 @@ xhci_reset_skip:
464464

465465
; Check Event ring for xHCI_ETRB_PSC and gather enabled ports
466466
xor ecx, ecx
467-
mov rdi, xhci_portlist
467+
mov edi, xhci_portlist
468468
mov rsi, os_usb_ERS
469469
sub rsi, 16
470470
xhci_check_port:

src/drivers/net/i8254x.asm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ net_i8254x_init:
1616
push rcx
1717
push rax
1818

19-
mov rdi, net_table
19+
mov edi, net_table
2020
xor eax, eax
2121
mov al, [os_net_icount]
2222
shl eax, 7 ; Quick multiply by 128
@@ -75,11 +75,11 @@ net_i8254x_init:
7575
call net_i8254x_reset
7676

7777
; Store call addresses
78-
mov rax, net_i8254x_config
78+
mov eax, net_i8254x_config
7979
mov [rdi+nt_config], rax
80-
mov rax, net_i8254x_transmit
80+
mov eax, net_i8254x_transmit
8181
mov [rdi+nt_transmit], rax
82-
mov rax, net_i8254x_poll
82+
mov eax, net_i8254x_poll
8383
mov [rdi+nt_poll], rax
8484

8585
net_i8254x_init_error:

src/drivers/net/i8257x.asm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ net_i8257x_init:
1919
push rcx
2020
push rax
2121

22-
mov rdi, net_table
22+
mov edi, net_table
2323
xor eax, eax
2424
mov al, [os_net_icount]
2525
shl eax, 7 ; Quick multiply by 128
@@ -78,11 +78,11 @@ net_i8257x_init:
7878
call net_i8257x_reset
7979

8080
; Store call addresses
81-
mov rax, net_i8257x_config
81+
mov eax, net_i8257x_config
8282
mov [rdi+nt_config], rax
83-
mov rax, net_i8257x_transmit
83+
mov eax, net_i8257x_transmit
8484
mov [rdi+nt_transmit], rax
85-
mov rax, net_i8257x_poll
85+
mov eax, net_i8257x_poll
8686
mov [rdi+nt_poll], rax
8787

8888
net_i8257x_init_error:

src/drivers/net/i8259x.asm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ net_i8259x_init:
1616
push rcx
1717
push rax
1818

19-
mov rdi, net_table
19+
mov edi, net_table
2020
xor eax, eax
2121
mov al, [os_net_icount]
2222
shl eax, 7 ; Quick multiply by 128
@@ -75,11 +75,11 @@ net_i8259x_init:
7575
call net_i8259x_reset
7676

7777
; Store call addresses
78-
mov rax, net_i8259x_config
78+
mov eax, net_i8259x_config
7979
mov [rdi+nt_config], rax
80-
mov rax, net_i8259x_transmit
80+
mov eax, net_i8259x_transmit
8181
mov [rdi+nt_transmit], rax
82-
mov rax, net_i8259x_poll
82+
mov eax, net_i8259x_poll
8383
mov [rdi+nt_poll], rax
8484
mov eax, i8259x_MAX_DESC - 1
8585
mov [rdi+nt_rx_tail], eax

src/drivers/net/virtio-net.asm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ net_virtio_init:
1717
push rbx
1818
push rax
1919

20-
mov rdi, net_table
20+
mov edi, net_table
2121
xor eax, eax
2222
mov al, [os_net_icount]
2323
shl eax, 7 ; Quick multiply by 128
@@ -199,11 +199,11 @@ virtio_net_init_cap_end:
199199

200200
; Store call addresses
201201
sub rdi, 0x28
202-
mov rax, net_virtio_config
202+
mov eax, net_virtio_config
203203
stosq
204-
mov rax, net_virtio_transmit
204+
mov eax, net_virtio_transmit
205205
stosq
206-
mov rax, net_virtio_poll
206+
mov eax, net_virtio_poll
207207
stosq
208208

209209
virtio_net_init_error:
@@ -445,7 +445,7 @@ net_virtio_transmit:
445445

446446
; Create first entry in the Descriptor Table
447447
mov rdi, r8
448-
mov rax, virtio_net_hdr ; Address of the 12-byte virtio_net_hdr
448+
mov eax, virtio_net_hdr ; Address of the 12-byte virtio_net_hdr
449449
stosq ; 64-bit address
450450
mov eax, 12
451451
stosd ; 32-bit length

src/drivers/nvs/ahci.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ ahci_init_search_ports_done:
175175

176176
ahci_init_done:
177177
bts word [os_nvsVar], 1 ; Set the bit flag that AHCI has been initialized
178-
mov rdi, os_nvs_io
179-
mov rax, ahci_io
178+
mov edi, os_nvs_io
179+
mov eax, ahci_io
180180
stosq
181-
mov rax, ahci_id
181+
mov eax, ahci_id
182182
stosq
183183
pop rdx
184184
pop rsi

src/drivers/nvs/ata.asm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
; -----------------------------------------------------------------------------
2121
ata_init:
2222
bts word [os_nvsVar], 2 ; Set the bit flag that ATA has been initialized
23-
mov rdi, os_nvs_io
24-
mov rax, ata_io
23+
mov edi, os_nvs_io
24+
mov eax, ata_io
2525
stosq
26-
mov rax, ata_id
26+
mov eax, ata_id
2727
stosq
2828
add rsi, 15
2929
mov byte [rsi], 1 ; Mark driver as installed in Bus Table
@@ -102,7 +102,7 @@ ata_io_nextsector:
102102

103103
ata_io_dataready:
104104
sub dx, 7 ; Data port (0x1F0)
105-
mov rcx, 256 ; Read
105+
mov rcx, 256 ; Read
106106
rep insw ; Copy a 512 byte sector to RDI
107107
add dx, 7 ; Set DX back to status register (0x01F7)
108108
in al, dx ; Delay ~400ns to allow drive to set new values of BSY and DRQ

src/drivers/nvs/nvme.asm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ nvme_init_LBA_end:
173173

174174
nvme_init_done:
175175
bts word [os_nvsVar], 0 ; Set the bit flag that NVMe has been initialized
176-
mov rdi, os_nvs_io
177-
mov rax, nvme_io
176+
mov edi, os_nvs_io
177+
mov eax, nvme_io
178178
stosq
179-
mov rax, nvme_id
179+
mov eax, nvme_id
180180
stosq
181181
pop rdx
182182
pop rsi
@@ -352,13 +352,13 @@ nvme_io_next_rpr:
352352
stosq
353353
sub rcx, 1
354354
cmp rcx, 0
355-
jne nvme_io_next_rpr
355+
jne nvme_io_next_rpr
356356
pop rdi
357357
mov rax, os_nvme_rpr
358358
jmp nvme_io_calc_rpr2_end ; Write the address of the RPR2 data
359359
nvme_io_calc_rpr2_skip:
360360
add rax, 4096
361-
nvme_io_calc_rpr2_end:
361+
nvme_io_calc_rpr2_end:
362362
stosq ; CDW8-9 PRP2
363363
pop rcx ; Restore the sector count
364364

@@ -463,7 +463,7 @@ NVMe_PMRCAP equ 0xE00 ; 4-byte Persistent Memory Region Capabilities
463463
NVMe_PMRCTL equ 0xE04 ; 4-byte Persistent Memory Region Control
464464
NVMe_PMRSTS equ 0xE08 ; 4-byte Persistent Memory Region Status
465465
NVMe_PMREBS equ 0xE0C ; 4-byte Persistent Memory Region Elasticity Buffer Size
466-
NVMe_PMRSWTP equ 0xE10 ; 4-byte Persistent Memory Region Sustained Write Throughput
466+
NVMe_PMRSWTP equ 0xE10 ; 4-byte Persistent Memory Region Sustained Write Throughput
467467
NVMe_PMRMSCL equ 0xE14 ; 4-byte Persistent Memory Region Memory Space Control Lower
468468
NVMe_PMRMSCU equ 0xE18 ; 4-byte Persistent Memory Region Memory Space Control Upper
469469

src/drivers/nvs/virtio-blk.asm

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ virtio_blk_init:
1515

1616
; Verify this driver supports the Vendor
1717
mov eax, [rsi+4] ; Offset to Vendor/Device ID in the Bus Table
18-
mov rsi, virtio_blk_driverid
18+
mov esi, virtio_blk_driverid
1919
mov bx, [rsi] ; Load the Vendor (0x1AF4)
2020
cmp ax, bx
2121
jne virtio_blk_init_error ; Bail out if it wasn't a match
@@ -105,7 +105,7 @@ virtio_blk_init_cap_end:
105105
; Device Initialization (section 3.1)
106106

107107
; 3.1.1 - Step 1 - Reset the device (section 2.4)
108-
mov al, 0x00
108+
mov al, 0x00
109109
mov [rsi+VIRTIO_DEVICE_STATUS], al
110110
virtio_blk_init_reset_wait:
111111
mov al, [rsi+VIRTIO_DEVICE_STATUS]
@@ -201,10 +201,10 @@ virtio_blk_init_pop:
201201

202202
virtio_blk_init_done:
203203
bts word [os_nvsVar], 3 ; Set the bit flag that Virtio Block has been initialized
204-
mov rdi, os_nvs_io ; Write over the storage function addresses
205-
mov rax, virtio_blk_io
204+
mov edi, os_nvs_io ; Write over the storage function addresses
205+
mov eax, virtio_blk_io
206206
stosq
207-
mov rax, virtio_blk_id
207+
mov eax, virtio_blk_id
208208
stosq
209209
pop rax
210210
pop rbx
@@ -248,7 +248,7 @@ virtio_blk_io:
248248
; FIXME: Add desc_index offset
249249

250250
; Add header to Descriptor Entry 0
251-
mov rax, header ; Address of the header
251+
mov eax, header ; Address of the header
252252
stosq ; 64-bit address
253253
mov eax, 16
254254
stosd ; 32-bit length
@@ -267,7 +267,7 @@ virtio_blk_io:
267267
add rdi, 2 ; Skip Next as it is pre-populated
268268

269269
; Add footer to Descriptor Entry 3
270-
mov rax, footer ; Address of the footer
270+
mov eax, footer ; Address of the footer
271271
stosq ; 64-bit address
272272
mov eax, 1
273273
stosd ; 32-bit length
@@ -276,7 +276,7 @@ virtio_blk_io:
276276
add rdi, 2 ; Skip Next as it is pre-populated
277277

278278
; Build the header
279-
mov rdi, header
279+
mov edi, header
280280
; BareMetal I/O opcode for Read is 2, Write is 1
281281
; Virtio-blk I/O opcode for Read is 0, Write is 1
282282
; FIXME: Currently we just clear bit 1.
@@ -290,7 +290,7 @@ virtio_blk_io:
290290
stosq ; starting sector
291291

292292
; Build the footer
293-
mov rdi, footer
293+
mov edi, footer
294294
xor eax, eax
295295
stosb
296296

@@ -331,7 +331,7 @@ virtio_blk_io_wait:
331331

332332

333333
; -----------------------------------------------------------------------------
334-
; virtio_blk_id --
334+
; virtio_blk_id --
335335
; IN: EAX = CDW0
336336
; EBX = CDW1
337337
; ECX = CDW10
@@ -380,15 +380,15 @@ VIRTIO_BLK_MIN_IO_SIZE equ 0x2E ; 16-bit SUGGESTED MINIMUM I/O SIZE IN BLOCKS
380380
VIRTIO_BLK_OPT_IO_SIZE equ 0x30 ; 32-bit OPTIMAL (SUGGESTED MAXIMUM) I/O SIZE IN BLOCKS
381381
VIRTIO_BLK_WRITEBACK equ 0x34 ; 8-bit
382382
VIRTIO_BLK_NUM_QUEUES equ 0x36 ; 16-bit
383-
VIRTIO_BLK_MAX_DISCARD_SECTORS equ 0x38 ; 32-bit
384-
VIRTIO_BLK_MAX_DISCARD_SEG equ 0x3C ; 32-bit
385-
VIRTIO_BLK_DISCARD_SECTOR_ALIGNMENT equ 0x40 ; 32-bit
386-
VIRTIO_BLK_MAX_WRITE_ZEROES_SECTORS equ 0x44 ; 32-bit
387-
VIRTIO_BLK_MAX_WRITE_ZEROES_SEG equ 0x48 ; 32-bit
383+
VIRTIO_BLK_MAX_DISCARD_SECTORS equ 0x38 ; 32-bit
384+
VIRTIO_BLK_MAX_DISCARD_SEG equ 0x3C ; 32-bit
385+
VIRTIO_BLK_DISCARD_SECTOR_ALIGNMENT equ 0x40 ; 32-bit
386+
VIRTIO_BLK_MAX_WRITE_ZEROES_SECTORS equ 0x44 ; 32-bit
387+
VIRTIO_BLK_MAX_WRITE_ZEROES_SEG equ 0x48 ; 32-bit
388388
VIRTIO_BLK_WRITE_ZEROES_MAY_UNMAP equ 0x4C ; 8-bit
389-
VIRTIO_BLK_MAX_SECURE_ERASE_SECTORS equ 0x50 ; 32-bit
390-
VIRTIO_BLK_MAX_SECURE_ERASE_SEG equ 0x54 ; 32-bit
391-
VIRTIO_BLK_SECURE_ERASE_SECTOR_ALIGNMENT equ 0x58 ; 32-bit
389+
VIRTIO_BLK_MAX_SECURE_ERASE_SECTORS equ 0x50 ; 32-bit
390+
VIRTIO_BLK_MAX_SECURE_ERASE_SEG equ 0x54 ; 32-bit
391+
VIRTIO_BLK_SECURE_ERASE_SECTOR_ALIGNMENT equ 0x58 ; 32-bit
392392

393393
; VIRTIO_DEVICEFEATURES bits
394394
VIRTIO_BLK_F_BARRIER equ 0 ; Legacy - Device supports request barriers

src/drivers/ps2.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ keydown:
120120
je keyboard_lowercase
121121

122122
keyboard_uppercase:
123-
mov rbx, keylayoutupper
123+
mov ebx, keylayoutupper
124124
jmp keyboard_processkey
125125

126126
keyboard_lowercase:
127-
mov rbx, keylayoutlower
127+
mov ebx, keylayoutlower
128128

129129
keyboard_processkey: ; Convert the scan code
130130
add rbx, rax

0 commit comments

Comments
 (0)