Browse Source

Svim buffer is now written to disk and loaded again

special_first_anniversary_edition
Jørn Guldberg 7 years ago
parent
commit
848cd0a802
  1. BIN
      SingOS.img
  2. BIN
      bootloader.bin
  3. BIN
      kernel.bin
  4. 2
      kernel.nasm
  5. 44
      lib/svim.nasm

BIN
SingOS.img

Binary file not shown.

BIN
bootloader.bin

Binary file not shown.

BIN
kernel.bin

Binary file not shown.

2
kernel.nasm

@ -239,4 +239,4 @@ data_os:
%include "lib/svim.nasm"
%include "lib/ls.nasm"
times 16384-($-$$) db 0
times 131072-($-$$) db 0

44
lib/svim.nasm

@ -30,6 +30,21 @@ svim:
mov dl, 0x00 ; coloumn zero
int 0x10
; Load from disk and, enter it, into the buffer
mov bx, ds
mov es, bx
xor bx, bx
mov bx, .buffer_for_svim
xor cx, cx
xor ax, ax
mov ah, 0x02 ;Read sectors from drive
mov al, 0x01 ;Number of sectors to read (8 * 512 = 4096 bytes)
mov ch, 0x02 ;Low 8 bits of cylinder
mov cl, 0x03 ;First sector to read (bits 0-5), upper bits of cylinder (bits 6-7)
mov dh, 0x01 ;Head number
mov dl, 0x00 ;Drive number
int 0x13
; print buffer
mov si, .buffer_for_svim
mov es, si
@ -74,24 +89,23 @@ svim:
mov bx, .buffer_for_svim
xor cx, cx
xor ax, ax
mov ah, 0x3 ;Write sectors from drive
mov al, 0x1 ;Number of sectors to read (8 * 512 = 4096 bytes)
mov cx, 0x2c ;First sector to read (bits 0-5), upper bits of cylinder (bits 6-7)
mov dh, 0x0 ;Head number
mov ah, 0x03 ;Write sectors to drive
mov al, 0x01 ;Number of sectors to write (8 * 512 = 4096 bytes)
mov cl, 0x03 ;First sector to read (bits 0-5), upper bits of cylinder (bits 6-7)
mov ch, 0x02
mov dh, 0x01 ;Head number
mov dl, 0x0 ;Drive number
int 0x13 ;Low level disk services
call dumpax_os
; clen up swim
;;xor bx, bx
;;xor cx, cx ; Upper and left coordinate
;;mov bh, 0x0f ; color for new screen 0 = black f = white
;;mov dh, 0xff ; Select all screen
;;mov dl, 0xff ; Select all screen
;;mov ah, 0x07 ; scrool down
;;mov al, 0x00 ; scrool 0 lines (means blank screen )
;;int 0x10
; clean up swim
xor bx, bx
xor cx, cx ; Upper and left coordinate
mov bh, 0x0f ; color for new screen 0 = black f = white
mov dh, 0xff ; Select all screen
mov dl, 0xff ; Select all screen
mov ah, 0x07 ; scrool down
mov al, 0x00 ; scrool 0 lines (means blank screen )
int 0x10
; Move curser back to the top of the screen
mov ah, 0x02
mov bh, 0x00 ; page number 0

Loading…
Cancel
Save