|
1 | 1 | ;;============================================================================== |
2 | 2 | ;; Real mode swich to protected mode | @file /asm/bios/start16.asm |
3 | | -;; |
| 3 | +;;============================================================================== |
4 | 4 | ;; Para bios boot primero real mode a protected mode. Uefi saltea esta parte, ya |
5 | 5 | ;; bootea en 64. |
6 | 6 | ;; |
|
19 | 19 | ;;extern failure |
20 | 20 | print_bios: equ 0x00de + 0x7c00 ;; print_bios en 0x7cde |
21 | 21 | vesa: equ 0x011d + 0x7c00 ;; print_bios en 0x011d |
| 22 | +diskcpy: equ 0x0 + 0x7c00 ;; print_bios en 0x011d |
| 23 | + |
| 24 | +msg_ok: equ 0x00 |
22 | 25 |
|
23 | 26 |
|
24 | 27 | ;; tsl.asm |
@@ -205,66 +208,32 @@ start32: |
205 | 208 |
|
206 | 209 |
|
207 | 210 |
|
208 | | -;;;;;;;;;;;;;;;; importante, aqui toma lo que le ha pasado desde bios, esto esta dentro de ifdef |
209 | | -;;;; por eso lo que le pasa difiere de uefi |
210 | | -;;;; leer info de video de VBEModeInfoBlock esta bien. Tener en cuenta que aqui es solo la asignacion para bios |
211 | | -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
212 | 211 |
|
213 | | - ; Save the frame buffer address, size (after its calculated), and the screen x,y |
214 | | - xor eax, eax |
215 | | - xor ebx, ebx |
| 212 | +load_tsl_hi: |
| 213 | + mov ax, print_bios |
| 214 | + mov si, msg_read_tsl_hi |
| 215 | + call ax ;; Calling using pointer works with directly defining functio addr. |
216 | 216 |
|
217 | | - mov ax, [0x5F00 + 16] ; BytesPerScanLine (modo vesa) |
218 | | - push eax |
219 | | - |
220 | | - mov bx, [0x5F00 + 16 + 2 * 2] ; YResolution (vesa) |
221 | | - push ebx |
| 217 | + mov ax, (512 + 1) ;; Cant sectors. Load 512 = 262144 bytes = 256 KiB + 1 ( |
| 218 | + ;; start16.asm). TO-DO: en realidad solo 240 que es el t |
| 219 | + ;; amano completo de la payload. Ya incluye a start16. R |
| 220 | + ;; evisar tamanos. |
| 221 | + mov bx, 6117 ;; Offset = 8192. |
| 222 | + mov cx, 0x7E00 ;; Destination. |
| 223 | + call diskcpy ;; Copia payload completo. En este momento no tengo acce |
| 224 | + ;; so a 0x800000 donde luego de activar modo progegido, |
| 225 | + ;; copiare tsl. |
222 | 226 |
|
223 | | - mov ax, [0x5F00 + 16 + 2] ; XResolution (vesa) |
224 | | - push eax |
225 | | - |
226 | | - mul ebx |
227 | | - mov ecx, eax |
228 | | - shl ecx, 2 ; Quick multiply by 4 |
229 | | - |
230 | | - |
231 | | -;; aqui en bios, deja las cosas en el mismo orden que uefi |
232 | | - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
233 | | -;;;[0x00005F00] ; Frame buffer base |
234 | | -;;;[0x00005F08] ; Frame buffer size (bytes) |
235 | | -;;;[0x00005F10] ; Screen X |
236 | | -;;;;[0x00005F12] ; Screen Y |
237 | | -;;;;[0x00005F14] ; PixelsPerScanLine |
238 | | -;;;;; recontramega importante (para bios, no uefi), aqui va a colocar |
239 | | - |
240 | | - mov edi, 0x5F00 |
241 | | - mov eax, [0x5F00 + 40];;;; ya que para bios, el vbeinfoblock tiene esta estructura (framebuffer en +40) |
242 | | - stosd ; 64-bit Frame Buffer Base (low) |
243 | | - ;;;;;;;; y pasandolo aqui 0x5f00 esta unificando un vbeInfoblock con estructura nueva tanto |
244 | | - ;;;;;;;; para efi como para bios |
245 | | - |
246 | | - xor eax, eax |
247 | | - stosd ; 64-bit Frame Buffer Base (high) completa qword |
248 | | - |
249 | | - mov eax, ecx |
250 | | - stosd ; 64-bit Frame Buffer Size in bytes (low) |
251 | | - xor eax, eax |
252 | | - stosd ; 64-bit Frame Buffer Size in bytes (high) |
253 | | - |
254 | | - pop eax |
255 | | - stosw ; 16-bit Screen X |
| 227 | + mov si, msg_ok |
| 228 | + call print_bios |
256 | 229 |
|
257 | | - pop eax |
258 | | - stosw ; 16-bit Screen Y |
259 | 230 |
|
260 | | - pop eax |
261 | | - shr eax, 2 ; 4 bytes / px => bpsl/4 |
262 | | - stosw ; PixelsPerScanLine |
263 | | - mov eax, 32 |
264 | | - stosw ; BitsPerPixel |
265 | 231 |
|
266 | 232 |
|
267 | 233 |
|
| 234 | + call buildVideoData |
| 235 | + |
| 236 | + |
268 | 237 | ;;;;;;;;;;;;;;;;; 7f23 |
269 | 238 | ;;;;;;;;;;;;;;;;;;;;;;;;; este salto lo hace bien |
270 | 239 |
|
@@ -436,4 +405,9 @@ mov al, [0x8000] |
436 | 405 |
|
437 | 406 | ;; TO-DO: agregar section data. |
438 | 407 |
|
439 | | -msg_e820: db "Performing e820..", 0 |
| 408 | +msg_e820: db "Performing e820..", 0 |
| 409 | +msg_read_tsl_hi: db "Reading tsl hi..", 0 |
| 410 | + |
| 411 | + |
| 412 | +;; Zero fill. |
| 413 | +times 512 - $ + $$ db 0 |
0 commit comments