diff options
-rw-r--r-- | 317abort.subx | 8 | ||||
-rw-r--r-- | 400.mu | 4 | ||||
-rw-r--r-- | apps/ex9.mu | 4 | ||||
-rw-r--r-- | apps/img.mu | 32 | ||||
-rw-r--r-- | boot.subx | 18 |
5 files changed, 33 insertions, 33 deletions
diff --git a/317abort.subx b/317abort.subx index 941862f9..643d1ef5 100644 --- a/317abort.subx +++ b/317abort.subx @@ -82,10 +82,10 @@ load-debug-symbols: # labels: (addr stream {start-address, label-slice}) c7 0/subop/copy *(ecx+4) 0/imm32 # read index c7 0/subop/copy *(ecx+8) 0x01000000/imm32 # stream capacity = 16MB # load 0x400 sectors starting from sector 10080 = 0x2760 - (load-sectors Primary-bus-primary-drive 0x2760 0x100 %ecx) - (load-sectors Primary-bus-primary-drive 0x2860 0x100 %ecx) - (load-sectors Primary-bus-primary-drive 0x2960 0x100 %ecx) - (load-sectors Primary-bus-primary-drive 0x2a60 0x100 %ecx) + (read-ata-disk Primary-bus-primary-drive 0x2760 0x100 %ecx) + (read-ata-disk Primary-bus-primary-drive 0x2860 0x100 %ecx) + (read-ata-disk Primary-bus-primary-drive 0x2960 0x100 %ecx) + (read-ata-disk Primary-bus-primary-drive 0x2a60 0x100 %ecx) # - parse pointers to portions of this stream into labels # var curr/ecx: (addr byte) = s->data 81 0/subop/add %ecx 0xc/imm32 diff --git a/400.mu b/400.mu index 0f0ccd00..dc655701 100644 --- a/400.mu +++ b/400.mu @@ -14,8 +14,8 @@ sig timer-counter -> _/eax: int sig read-key kbd: (addr keyboard) -> _/eax: byte # disk -sig load-sectors disk: (addr disk), lba: int, n: int, out: (addr stream byte) -sig store-sectors disk: (addr disk), lba: int, n: int, out: (addr stream byte) +sig read-ata-disk disk: (addr disk), lba: int, n: int, out: (addr stream byte) +sig write-ata-disk disk: (addr disk), lba: int, n: int, out: (addr stream byte) # mouse sig read-mouse-event -> _/eax: int, _/ecx: int diff --git a/apps/ex9.mu b/apps/ex9.mu index 30853c69..f256e349 100644 --- a/apps/ex9.mu +++ b/apps/ex9.mu @@ -18,14 +18,14 @@ fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { var text-storage: (stream byte 0x200) var text/esi: (addr stream byte) <- address text-storage - load-sectors data-disk, 0/lba, 1/num-sectors, text + read-ata-disk data-disk, 0/lba, 1/num-sectors, text var word-count/eax: int <- word-count text var result-storage: (stream byte 0x10) var result/edi: (addr stream byte) <- address result-storage write-int32-decimal result, word-count - store-sectors data-disk, 0/lba, 1/num-sectors, result + write-ata-disk data-disk, 0/lba, 1/num-sectors, result } fn word-count in: (addr stream byte) -> _/eax: int { diff --git a/apps/img.mu b/apps/img.mu index 65b773c5..b54840ff 100644 --- a/apps/img.mu +++ b/apps/img.mu @@ -36,22 +36,22 @@ fn load-image self: (addr image), data-disk: (addr disk) { var s/ebx: (addr stream byte) <- address s-storage draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "loading sectors from data disk", 3/fg, 0/bg move-cursor-to-left-margin-of-next-line 0/screen - load-sectors data-disk, 0/lba, 0x100/sectors, s - load-sectors data-disk, 0x100/lba, 0x100/sectors, s - load-sectors data-disk, 0x200/lba, 0x100/sectors, s - load-sectors data-disk, 0x300/lba, 0x100/sectors, s - load-sectors data-disk, 0x400/lba, 0x100/sectors, s - load-sectors data-disk, 0x500/lba, 0x100/sectors, s - load-sectors data-disk, 0x600/lba, 0x100/sectors, s - load-sectors data-disk, 0x700/lba, 0x100/sectors, s - load-sectors data-disk, 0x800/lba, 0x100/sectors, s - load-sectors data-disk, 0x900/lba, 0x100/sectors, s - load-sectors data-disk, 0xa00/lba, 0x100/sectors, s - load-sectors data-disk, 0xb00/lba, 0x100/sectors, s - load-sectors data-disk, 0xc00/lba, 0x100/sectors, s - load-sectors data-disk, 0xd00/lba, 0x100/sectors, s - load-sectors data-disk, 0xe00/lba, 0x100/sectors, s - load-sectors data-disk, 0xf00/lba, 0x100/sectors, s + read-ata-disk data-disk, 0/lba, 0x100/sectors, s + read-ata-disk data-disk, 0x100/lba, 0x100/sectors, s + read-ata-disk data-disk, 0x200/lba, 0x100/sectors, s + read-ata-disk data-disk, 0x300/lba, 0x100/sectors, s + read-ata-disk data-disk, 0x400/lba, 0x100/sectors, s + read-ata-disk data-disk, 0x500/lba, 0x100/sectors, s + read-ata-disk data-disk, 0x600/lba, 0x100/sectors, s + read-ata-disk data-disk, 0x700/lba, 0x100/sectors, s + read-ata-disk data-disk, 0x800/lba, 0x100/sectors, s + read-ata-disk data-disk, 0x900/lba, 0x100/sectors, s + read-ata-disk data-disk, 0xa00/lba, 0x100/sectors, s + read-ata-disk data-disk, 0xb00/lba, 0x100/sectors, s + read-ata-disk data-disk, 0xc00/lba, 0x100/sectors, s + read-ata-disk data-disk, 0xd00/lba, 0x100/sectors, s + read-ata-disk data-disk, 0xe00/lba, 0x100/sectors, s + read-ata-disk data-disk, 0xf00/lba, 0x100/sectors, s draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "parsing", 3/fg, 0/bg move-cursor-to-left-margin-of-next-line 0/screen initialize-image self, s diff --git a/boot.subx b/boot.subx index 2c468458..18f54748 100644 --- a/boot.subx +++ b/boot.subx @@ -973,7 +973,7 @@ Primary-bus-secondary-drive: == code # No more than 0x100 sectors -load-sectors: # disk: (addr disk), lba: int, n: int, out: (addr stream byte) +read-ata-disk: # disk: (addr disk), lba: int, n: int, out: (addr stream byte) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -985,12 +985,12 @@ load-sectors: # disk: (addr disk), lba: int, n: int, out: (addr stream byte) 81 7/subop/compare *(ebp+0x10) 0x100/imm32 { 7e/jump-if-<= break/disp8 - (abort "load-sectors: no more than 0x100 sectors") + (abort "read-ata-disk: no more than 0x100 sectors") } # check for drive (drive-exists? *(ebp+8)) # => eax 3d/compare-eax-and 0/imm32/false - 0f 84/jump-if-= $load-sectors:end/disp32 + 0f 84/jump-if-= $read-ata-disk:end/disp32 # kick off read (ata-drive-select *(ebp+8) *(ebp+0xc)) (clear-ata-error *(ebp+8)) @@ -1032,7 +1032,7 @@ load-sectors: # disk: (addr disk), lba: int, n: int, out: (addr stream byte) #? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "next sector\n" 7 0) e9/jump loop/disp32 } -$load-sectors:end: +$read-ata-disk:end: # . restore registers 5a/pop-to-edx 59/pop-to-ecx @@ -1042,7 +1042,7 @@ $load-sectors:end: 5d/pop-to-ebp c3/return -store-sectors: # disk: (addr disk), lba: int, n: int, in: (addr stream byte) +write-ata-disk: # disk: (addr disk), lba: int, n: int, in: (addr stream byte) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -1054,7 +1054,7 @@ store-sectors: # disk: (addr disk), lba: int, n: int, in: (addr stream byte) # check for drive (drive-exists? *(ebp+8)) # => eax 3d/compare-eax-and 0/imm32/false - 0f 84/jump-if-= $store-sectors:end/disp32 + 0f 84/jump-if-= $write-ata-disk:end/disp32 # kick off write (ata-drive-select *(ebp+8) *(ebp+0xc)) (clear-ata-error *(ebp+8)) @@ -1077,7 +1077,7 @@ store-sectors: # disk: (addr disk), lba: int, n: int, in: (addr stream byte) # . when it's more than 0xff, we're at an even-numbered byte bb/copy-to-ebx 0xffff/imm32 #? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "D" 7 0) -$store-sectors:store-sector: +$write-ata-disk:store-sector: { 81 7/subop/compare %ecx 0/imm32 74/jump-if-= break/disp8 @@ -1092,7 +1092,7 @@ $store-sectors:store-sector: { 7e/jump-if-<= break/disp8 89/<- %ebx 0/r32/eax - eb/jump $store-sectors:store-sector/disp8 + eb/jump $write-ata-disk:store-sector/disp8 } # otherwise OR it with first-byte and write it out c1/shift 4/subop/left %eax 8/imm8 @@ -1138,7 +1138,7 @@ $store-sectors:store-sector: #? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "F" 7 0) (flush-ata-cache *(ebp+8)) #? (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "Y" 7 0) -$store-sectors:end: +$write-ata-disk:end: # . restore registers 5b/pop-to-ebx 5a/pop-to-edx |