diff options
author | LAN-TW <lantw44@gmail.com> | 2013-12-04 21:32:57 +0800 |
---|---|---|
committer | LAN-TW <lantw44@gmail.com> | 2013-12-04 21:32:57 +0800 |
commit | 209234c1e607ee307cfa9b776d487df40e1d0290 (patch) | |
tree | aca81746f263d8e1f00a9b01f973795c967d18b8 /bootsect.s | |
parent | 6b105d56d80b0fbef5f9108f7c0063574febc4a9 (diff) | |
download | yotos-master.tar yotos-master.tar.gz yotos-master.tar.bz2 yotos-master.tar.lz yotos-master.tar.xz yotos-master.tar.zst yotos-master.zip |
Diffstat (limited to 'bootsect.s')
-rw-r--r-- | bootsect.s | 108 |
1 files changed, 54 insertions, 54 deletions
@@ -1,54 +1,54 @@ - org 0x7c00 ; boot sector
-
-entry:
- ; now loading from disk
- mov cx, 3 ; retry count
- mov ax, 0x0000
- mov ds, ax
- mov ax, 0x9050
- mov es, ax ; set es, the destination
- mov bx, 0
-loaddisk:
- mov si, cx
- mov ah, 0x02 ; function: read disk sectors
- mov al, 16 ; sector count
- mov dh, 0 ; head
- mov dl, 0 ; drive number
- mov ch, 0 ; track
- mov cl, 2 ; sector offset
- int 0x13
- jnc loadok
- mov bl, al
- call putcharhex
- mov cx, si
- loop loaddisk
-
- ; load failed
- mov ah, 0x0e
- mov al, 'X'
- int 0x10
- jmp $
-
- ; load OK
-loadok:
- mov ah, 0x0e
- mov al, 'P'
- int 0x10
- mov al, 'R'
- int 0x10
- mov al, 'E'
- int 0x10
- mov al, 'Y'
- int 0x10
- mov al, 'O'
- int 0x10
- mov al, 'T'
- int 0x10
- mov ax, 0x9050
- mov ds, ax
- mov es, ax
- mov ss, ax
- db 0xEA
- dd 0x90500000
-
-%include "basic.s"
+ org 0x7c00 ; boot sector + +entry: + ; now loading from disk + mov cx, 3 ; retry count + mov ax, 0x0000 + mov ds, ax + mov ax, 0x9050 + mov es, ax ; set es, the destination + mov bx, 0 +loaddisk: + mov si, cx + mov ah, 0x02 ; function: read disk sectors + mov al, 16 ; sector count + mov dh, 0 ; head + mov dl, 0 ; drive number + mov ch, 0 ; track + mov cl, 2 ; sector offset + int 0x13 + jnc loadok + mov bl, al + call putcharhex + mov cx, si + loop loaddisk + + ; load failed + mov ah, 0x0e + mov al, 'X' + int 0x10 + jmp $ + + ; load OK +loadok: + mov ah, 0x0e + mov al, 'P' + int 0x10 + mov al, 'R' + int 0x10 + mov al, 'E' + int 0x10 + mov al, 'Y' + int 0x10 + mov al, 'O' + int 0x10 + mov al, 'T' + int 0x10 + mov ax, 0x9050 + mov ds, ax + mov es, ax + mov ss, ax + db 0xEA + dd 0x90500000 + +%include "basic.s" |