1 | ; ----------------------------------------------------------------------- |
---|
2 | ; |
---|
3 | ; Copyright 2010 Gene Cumm |
---|
4 | ; |
---|
5 | ; Portions from diskstart.inc: |
---|
6 | ; Copyright 1994-2009 H. Peter Anvin - All Rights Reserved |
---|
7 | ; Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin |
---|
8 | ; |
---|
9 | ; This program is free software; you can redistribute it and/or modify |
---|
10 | ; it under the terms of the GNU General Public License as published by |
---|
11 | ; the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, |
---|
12 | ; Boston MA 02110-1301, USA; either version 2 of the License, or |
---|
13 | ; (at your option) any later version; incorporated herein by reference. |
---|
14 | ; |
---|
15 | ; ----------------------------------------------------------------------- |
---|
16 | |
---|
17 | ; |
---|
18 | ; geodsplib.inc |
---|
19 | ; |
---|
20 | ; Library file for geodsp*.asm |
---|
21 | ; |
---|
22 | |
---|
23 | ; ES:BX points to the buffer with address |
---|
24 | ; DX,CX as they should be for INT13h,AH=02 |
---|
25 | ; For now assume C<256 |
---|
26 | write_chs_lba: |
---|
27 | pushad |
---|
28 | mov si,s_atchs |
---|
29 | call writestr_early |
---|
30 | call write_chs |
---|
31 | mov al,':' |
---|
32 | call writechr |
---|
33 | mov eax,[es:bx] |
---|
34 | call writehex8 |
---|
35 | call crlf |
---|
36 | popad |
---|
37 | ret |
---|
38 | |
---|
39 | ; DX,CX as they should be for INT13h,AH=02 |
---|
40 | ; For now assume C<256 |
---|
41 | write_chs: |
---|
42 | pushad |
---|
43 | mov al,ch |
---|
44 | mov ah,cl |
---|
45 | shr ah,6 |
---|
46 | call writehex4 |
---|
47 | mov al,',' |
---|
48 | call writechr |
---|
49 | mov al,dh |
---|
50 | call writehex2 |
---|
51 | mov al,',' |
---|
52 | call writechr |
---|
53 | mov al,cl |
---|
54 | and al,3Fh |
---|
55 | call writehex2 |
---|
56 | popad |
---|
57 | ret |
---|
58 | |
---|
59 | write_edd_lba: |
---|
60 | pushad |
---|
61 | mov si,s_atchs |
---|
62 | call writestr_early |
---|
63 | call writehex8 |
---|
64 | mov al,':' |
---|
65 | call writechr |
---|
66 | mov eax,[es:bx] |
---|
67 | call writehex8 |
---|
68 | call crlf |
---|
69 | popad |
---|
70 | ret |
---|
71 | |
---|
72 | |
---|
73 | crlf: |
---|
74 | push si |
---|
75 | mov si,s_crlf |
---|
76 | call writestr_early |
---|
77 | pop si |
---|
78 | ret |
---|
79 | |
---|
80 | writechr: |
---|
81 | writechr_early: |
---|
82 | pushad |
---|
83 | mov ah,0Eh ; Write to screen as TTY |
---|
84 | mov bx,0007h ; Attribute |
---|
85 | int 10h |
---|
86 | popad |
---|
87 | ret |
---|
88 | |
---|
89 | %include "writehex.inc" |
---|
90 | |
---|
91 | s_atchs: db '@' |
---|
92 | s_chs: db 'CHS' |
---|
93 | s_space: db ' ', 0 |
---|
94 | s_typespec: db 'D=' |
---|
95 | s_type: db 'CHS', 0 |
---|
96 | s_end: db 0Dh, 0Ah, 'end' |
---|
97 | s_crlf: db 0Dh, 0Ah, 0 |
---|
98 | |
---|
99 | ; This indicates the general format of the last few bytes in the boot sector |
---|
100 | BS_MAGIC_VER equ 0x1b << 9 |
---|