blob: daa8d7ad8517a5795eaf701a2eb61d4db8bf56aa [file] [log] [blame]
Kevin O'Connorf076a3e2008-02-25 22:25:15 -05001// Rom layout and bios assembler to C interface.
2//
3// Copyright (C) 2008 Kevin O'Connor <kevin@koconnor.net>
4// Copyright (C) 2002 MandrakeSoft S.A.
5//
6// This file may be distributed under the terms of the GNU GPLv3 license.
7
8#include "config.h"
9
Kevin O'Connor21e930b2008-03-01 09:49:37 -050010#define PROTECTED_MODE_CS (2 << 3) // 0x10
11#define PROTECTED_MODE_DS (3 << 3) // 0x18
12#define REAL_MODE_CS (4 << 3) // 0x20
13#define REAL_MODE_DS (5 << 3) // 0x28
14
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -050015
16/****************************************************************
17 * Include of 16bit C code
18 ****************************************************************/
19
Kevin O'Connor74534532008-05-12 18:28:58 -040020 .code16gcc
21.include "out/blob.16.s"
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050022
23
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -050024/****************************************************************
Kevin O'Connor1d019512008-03-11 21:21:47 -040025 * Entry macros
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -050026 ****************************************************************/
27
Kevin O'Connor1d019512008-03-11 21:21:47 -040028 // Call a C function - this does the minimal work necessary to
29 // call into C. It sets up %ds, backs up %es, and backs up
30 // those registers that are call clobbered by the C compiler.
31 .macro ENTRY cfunc
32 cld
Kevin O'Connor18f368e2008-03-31 21:56:04 -040033 pushl %eax // Save registers clobbered by C code
Kevin O'Connor1d019512008-03-11 21:21:47 -040034 pushl %ecx
35 pushl %edx
36 pushw %es
37 pushw %ds
Kevin O'Connor18f368e2008-03-31 21:56:04 -040038 movw %ss, %ax // Move %ss to %ds
Kevin O'Connor1d019512008-03-11 21:21:47 -040039 movw %ax, %ds
Kevin O'Connorb3c28be2008-06-08 13:34:43 -040040 pushl %esp // Backup %esp, then clear high bits
41 movzwl %sp, %esp
Kevin O'Connor1d019512008-03-11 21:21:47 -040042 calll \cfunc
Kevin O'Connorb3c28be2008-06-08 13:34:43 -040043 popl %esp // Restore %esp (including high bits)
Kevin O'Connor18f368e2008-03-31 21:56:04 -040044 popw %ds // Restore registers saved above
Kevin O'Connor1d019512008-03-11 21:21:47 -040045 popw %es
46 popl %edx
47 popl %ecx
48 popl %eax
49 .endm
50
51 // Call a C function with current register list as an
52 // argument. This backs up the registers and sets %eax
53 // to point to the backup. On return, the registers are
54 // restored from the structure.
55 .macro ENTRY_ARG cfunc
56 cld
Kevin O'Connor18f368e2008-03-31 21:56:04 -040057 pushl %eax // Save registers (matches struct bregs)
Kevin O'Connor1d019512008-03-11 21:21:47 -040058 pushl %ecx
59 pushl %edx
60 pushl %ebx
61 pushl %esi
62 pushl %edi
63 pushw %es
64 pushw %ds
Kevin O'Connor18f368e2008-03-31 21:56:04 -040065 movw %ss, %ax // Move %ss to %ds
Kevin O'Connor1d019512008-03-11 21:21:47 -040066 movw %ax, %ds
Kevin O'Connorb3c28be2008-06-08 13:34:43 -040067 movl %esp, %ebx // Backup %esp, then zero high bits
68 movzwl %sp, %esp
69 movl %esp, %eax // First arg is pointer to struct bregs
70 calll \cfunc
71 movl %ebx, %esp // Restore %esp (including high bits)
72 popw %ds // Restore registers (from struct bregs)
73 popw %es
74 popl %edi
75 popl %esi
76 popl %ebx
77 popl %edx
78 popl %ecx
79 popl %eax
80 .endm
81
82 // As above, but don't mangle %esp
83 .macro ENTRY_ARG_ESP cfunc
84 cld
85 pushl %eax // Save registers (matches struct bregs)
86 pushl %ecx
87 pushl %edx
88 pushl %ebx
89 pushl %esi
90 pushl %edi
91 pushw %es
92 pushw %ds
93 movw %ss, %ax // Move %ss to %ds
94 movw %ax, %ds
Kevin O'Connor18f368e2008-03-31 21:56:04 -040095 movl %esp, %eax // First arg is pointer to struct bregs
Kevin O'Connor1d019512008-03-11 21:21:47 -040096 calll \cfunc
Kevin O'Connor18f368e2008-03-31 21:56:04 -040097 popw %ds // Restore registers (from struct bregs)
Kevin O'Connor1d019512008-03-11 21:21:47 -040098 popw %es
99 popl %edi
100 popl %esi
101 popl %ebx
102 popl %edx
103 popl %ecx
104 popl %eax
105 .endm
106
Kevin O'Connorbdce35f2008-02-26 21:33:14 -0500107 // Macro to reset the 16bit stack
108 // Clobbers %ax
109 .macro RESET_STACK
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500110 xorw %ax, %ax
111 movw %ax, %ss
Kevin O'Connor276d4a92008-06-11 22:47:01 -0400112 movl $ BUILD_STACK_ADDR , %esp
Kevin O'Connorbdce35f2008-02-26 21:33:14 -0500113 .endm
114
Kevin O'Connor74534532008-05-12 18:28:58 -0400115 // Specify a location in the fixed part of bios area.
116 .macro ORG addr
117 .section .text.fixed.addr
Kevin O'Connor276d4a92008-06-11 22:47:01 -0400118 .org \addr - BUILD_START_FIXED
Kevin O'Connor74534532008-05-12 18:28:58 -0400119 .endm
120
Kevin O'Connor1d019512008-03-11 21:21:47 -0400121
122/****************************************************************
123 * POST handler
124 ****************************************************************/
125
Kevin O'Connor74534532008-05-12 18:28:58 -0400126 ORG 0xe05b
Kevin O'Connorbdce35f2008-02-26 21:33:14 -0500127 .globl post16
128post16:
129 // init the stack pointer
130 RESET_STACK
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500131
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500132 // Set entry point of rombios32 code - the actual address
Kevin O'Connor21e930b2008-03-01 09:49:37 -0500133 // is altered later in the build process.
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500134 .globl set_entry32
135set_entry32:
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500136 pushl $0xf0000000
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500137
Kevin O'Connor7a558e42008-03-11 20:38:33 -0400138 cld
139
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500140 // Fall through to transition32 function below
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500141
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500142
143/****************************************************************
144 * Call trampolines
145 ****************************************************************/
146
147// Place CPU into 32bit mode from 16bit mode.
148// Clobbers: %eax, flags, stack registers, cr0, idt/gdt
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500149transition32:
150 // Disable irqs
151 cli
152
153 // enable a20
154 inb $0x92, %al
155 orb $0x02, %al
156 outb %al, $0x92
157
158 // Set segment descriptors
159 lidt %cs:pmode_IDT_info
160 lgdt %cs:rombios32_gdt_48
161
162 // set PE bit in CR0
163 movl %cr0, %eax
164 orb $0x01, %al
165 movl %eax, %cr0
166
167 // start protected mode code
Kevin O'Connorcb6735f2008-03-01 13:39:52 -0500168 // ljmpl $PROTECTED_MODE_CS, $(1f | 0xf0000)
169 .word 0xea66, 1f, 0x000f, PROTECTED_MODE_CS
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500170
171 .code32
1721:
173 // init data segments
Kevin O'Connor21e930b2008-03-01 09:49:37 -0500174 movl $PROTECTED_MODE_DS, %eax
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500175 movw %ax, %ds
176 movw %ax, %es
177 movw %ax, %ss
178 xorl %eax, %eax
179 movw %ax, %fs
180 movw %ax, %gs
181
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500182 retl
183
184// Call a 16bit function from 32bit mode.
Kevin O'Connorcb6735f2008-03-01 13:39:52 -0500185// %eax = address of struct bregs
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500186// Clobbers: all gp registers, flags, stack registers, cr0, idt/gdt
187 .globl __call16_from32
188__call16_from32:
189 pushl %eax
190
191 // Jump to 16bit mode
Kevin O'Connor68296e82008-03-13 21:33:26 -0400192 ljmpw $REAL_MODE_CS, $1f
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500193
194 .code16gcc
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -05001951:
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500196 // restore data segment limits to 0xffff
Kevin O'Connoracad0a62008-03-02 23:24:16 -0500197 movw $REAL_MODE_DS, %ax
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500198 movw %ax, %ds
199 movw %ax, %es
200 movw %ax, %ss
201 movw %ax, %fs
202 movw %ax, %gs
203
204 // reset PE bit in CR0
205 movl %cr0, %eax
206 andb $0xfe, %al
207 movl %eax, %cr0
208
209 // far jump to flush CPU queue after transition to real mode
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500210 ljmpw $0xf000, $2f
Kevin O'Connor21e930b2008-03-01 09:49:37 -0500211
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -05002122:
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500213 // restore IDT to normal real-mode defaults
214 lidt %cs:rmode_IDT_info
215
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500216 // Clear segment registers
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500217 xorw %ax, %ax
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500218 movw %ax, %fs
219 movw %ax, %gs
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500220 movw %ax, %es
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500221 movw %ax, %ds
222 movw %ax, %ss // Assume stack is in segment 0
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500223
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500224 popl %eax
Kevin O'Connor18f368e2008-03-31 21:56:04 -0400225
226 // Set __call16 return address to be transition32
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500227 pushl $transition32
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500228
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500229 // Fall through to __call16
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500230
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500231
Kevin O'Connor21e930b2008-03-01 09:49:37 -0500232// Call a 16bit function from 16bit mode with a specified cpu register state
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500233// %eax = address of struct bregs
234// Clobbers: all gp registers, es
235 .globl __call16
236__call16:
237 // Save eax
238 pushl %eax
239
240 // Setup for iretw call
241 pushw $0xf000
242 pushw $1f // return point
Kevin O'Connor1d019512008-03-11 21:21:47 -0400243 pushw 0x20(%eax) // flags
244 pushl 0x1c(%eax) // CS:IP
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500245
246 // Load calling registers.
247 movl 0x04(%eax), %edi
248 movl 0x08(%eax), %esi
Kevin O'Connor1d019512008-03-11 21:21:47 -0400249 movl 0x0c(%eax), %ebx
250 movl 0x10(%eax), %edx
251 movl 0x14(%eax), %ecx
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500252 movw 0x02(%eax), %es // XXX - should load %ds too
Kevin O'Connor1d019512008-03-11 21:21:47 -0400253 movl 0x18(%eax), %eax
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500254
255 // Invoke call
256 iretw // XXX - just do a lcalll
2571:
258 // Store flags, eax, ecx
259 pushfw
260 pushl %eax
261 movl 0x06(%esp), %eax
Kevin O'Connor1d019512008-03-11 21:21:47 -0400262 movl %ecx, %ss:0x14(%eax) // Save %ecx
Kevin O'Connorcbbb6672008-03-08 13:04:10 -0500263 movw %ss, %cx
264 movw %cx, %ds // Restore %ds == %ss
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500265 popl %ecx
Kevin O'Connor1d019512008-03-11 21:21:47 -0400266 movl %ecx, 0x18(%eax) // Save %eax
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500267 popw %cx
Kevin O'Connor1d019512008-03-11 21:21:47 -0400268 movw %cx, 0x20(%eax) // Save flags
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500269
270 // Store remaining registers
271 movw %es, 0x02(%eax)
272 movl %edi, 0x04(%eax)
273 movl %esi, 0x08(%eax)
Kevin O'Connor1d019512008-03-11 21:21:47 -0400274 movl %ebx, 0x0c(%eax)
275 movl %edx, 0x10(%eax)
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500276
277 // Remove %eax
278 popl %eax
279
Kevin O'Connored128492008-03-11 11:14:59 -0400280 cld
281
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500282 retl
283
Kevin O'Connor18f368e2008-03-31 21:56:04 -0400284
285// APM trampolines
Kevin O'Connor1d019512008-03-11 21:21:47 -0400286 .globl apm16protected_entry
287apm16protected_entry:
288 pushfw // save flags
289 pushl %eax // dummy
290 ENTRY_ARG handle_1553
Kevin O'Connorb3c28be2008-06-08 13:34:43 -0400291 addw $4, %sp // pop dummy
Kevin O'Connor1d019512008-03-11 21:21:47 -0400292 popfw // restore flags
293 lretw
294
295 .code32
296 .globl apm32protected_entry
297apm32protected_entry:
Kevin O'Connor68296e82008-03-13 21:33:26 -0400298 pushfw
299 pushw %cs // Setup for long jump to 16bit mode
300 pushw $1f
Kevin O'Connor0fae9e12008-06-07 14:51:14 -0400301 addw $8, 2(%esp)
Kevin O'Connor68296e82008-03-13 21:33:26 -0400302 ljmpw *(%esp)
303 .code16gcc
3041:
Kevin O'Connorb3c28be2008-06-08 13:34:43 -0400305 ENTRY_ARG_ESP handle_1553
Kevin O'Connor68296e82008-03-13 21:33:26 -0400306
307 movw $2f,(%esp) // Setup for long jump back to 32bit mode
Kevin O'Connor0fae9e12008-06-07 14:51:14 -0400308 subw $8, 2(%esp)
Kevin O'Connor68296e82008-03-13 21:33:26 -0400309 ljmpw *(%esp)
310 .code32
3112:
Kevin O'Connor1d019512008-03-11 21:21:47 -0400312 addl $4, %esp // pop call address
313 popfw
314 lretl
315 .code16gcc
Kevin O'Connor1d019512008-03-11 21:21:47 -0400316
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500317
318/****************************************************************
319 * GDT and IDT tables
320 ****************************************************************/
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500321
322// Protected mode IDT descriptor
323//
324// I just make the limit 0, so the machine will shutdown
325// if an exception occurs during protected mode memory
326// transfers.
327//
328// Set base to f0000 to correspond to beginning of BIOS,
329// in case I actually define an IDT later
330// Set limit to 0
331pmode_IDT_info:
332 .word 0x0000 // limit 15:00
Kevin O'Connorddd4bfd2008-02-28 20:00:20 -0500333 .long 0xf0000 // base 16:47
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500334
335// Real mode IDT descriptor
336//
337// Set to typical real-mode values.
338// base = 000000
339// limit = 03ff
340rmode_IDT_info:
341 .word 0x03ff // limit 15:00
Kevin O'Connorddd4bfd2008-02-28 20:00:20 -0500342 .long 0 // base 16:47
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500343
344rombios32_gdt_48:
345 .word 0x30
346 .word rombios32_gdt
347 .word 0x000f
348
Kevin O'Connor44c631d2008-03-02 11:24:36 -0500349 .balign 8
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500350rombios32_gdt:
351 .word 0, 0, 0, 0
352 .word 0, 0, 0, 0
Kevin O'Connorcb6735f2008-03-01 13:39:52 -0500353 // 32 bit flat code segment (PROTECTED_MODE_CS)
354 .word 0xffff, 0, 0x9b00, 0x00cf
355 // 32 bit flat data segment (PROTECTED_MODE_DS)
356 .word 0xffff, 0, 0x9300, 0x00cf
357 // 16 bit code segment base=0xf0000 limit=0xffff (REAL_MODE_CS)
358 .word 0xffff, 0, 0x9b0f, 0x0000
359 // 16 bit data segment base=0x0 limit=0xffff (REAL_MODE_DS)
360 .word 0xffff, 0, 0x9300, 0x0000
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500361
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500362
363/****************************************************************
364 * Interrupt entry points
365 ****************************************************************/
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500366
Kevin O'Connored128492008-03-11 11:14:59 -0400367 // Define an entry point for an interrupt (no args passed).
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500368 .macro IRQ_ENTRY num
369 .globl entry_\num
370 entry_\num :
Kevin O'Connor44d65302008-03-08 11:34:46 -0500371 cli // In case something far-calls instead of using "int"
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500372 ENTRY handle_\num
373 iretw
374 .endm
375
Kevin O'Connored128492008-03-11 11:14:59 -0400376 // Define an entry point for an interrupt (can read/modify args).
377 .macro IRQ_ENTRY_ARG num
378 .globl entry_\num
379 entry_\num :
380 cli // In case something far-calls instead of using "int"
381 ENTRY_ARG handle_\num
382 iretw
383 .endm
384
Kevin O'Connor74534532008-05-12 18:28:58 -0400385 ORG 0xe2c3
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500386 IRQ_ENTRY nmi
387
Kevin O'Connored128492008-03-11 11:14:59 -0400388 IRQ_ENTRY_ARG 13
389 IRQ_ENTRY_ARG 12
390 IRQ_ENTRY_ARG 11
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500391 IRQ_ENTRY 76
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500392 IRQ_ENTRY 1c
393 IRQ_ENTRY 70
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500394
Kevin O'Connor74534532008-05-12 18:28:58 -0400395 ORG 0xe3fe
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500396 jmp entry_13
397
Kevin O'Connor74534532008-05-12 18:28:58 -0400398 ORG 0xe401
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500399 // XXX - Fixed Disk Parameter Table
400
Kevin O'Connor74534532008-05-12 18:28:58 -0400401 ORG 0xe6f2
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500402 jmp entry_19
403
Kevin O'Connor74534532008-05-12 18:28:58 -0400404 ORG 0xe6f5
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500405.include "out/cbt.proc.16.s"
406 .text
407
Kevin O'Connor74534532008-05-12 18:28:58 -0400408 ORG 0xe729
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500409 // XXX - Baud Rate Generator Table
410
Kevin O'Connor74534532008-05-12 18:28:58 -0400411 ORG 0xe739
Kevin O'Connored128492008-03-11 11:14:59 -0400412 IRQ_ENTRY_ARG 14
413
Kevin O'Connor18f368e2008-03-31 21:56:04 -0400414 IRQ_ENTRY 74
Kevin O'Connor1d019512008-03-11 21:21:47 -0400415 IRQ_ENTRY 75
416
Kevin O'Connored128492008-03-11 11:14:59 -0400417 // int 18/19 are special - they reset the stack and do not return.
418 .globl entry_19
419entry_19:
420 RESET_STACK
421 ENTRY handle_19
422
423 .globl entry_18
424entry_18:
425 RESET_STACK
426 ENTRY handle_18
427
428 // IRQ trampolines
429 .macro IRQ_TRAMPOLINE num
430 .globl irq_trampoline_0x\num
431 irq_trampoline_0x\num :
432 int $0x\num
433 lretw
434 .endm
435
436 IRQ_TRAMPOLINE 02
437 IRQ_TRAMPOLINE 10
438 IRQ_TRAMPOLINE 13
439 IRQ_TRAMPOLINE 15
Kevin O'Connore0113c92008-04-05 15:51:12 -0400440 IRQ_TRAMPOLINE 16
Kevin O'Connored128492008-03-11 11:14:59 -0400441 IRQ_TRAMPOLINE 18
442 IRQ_TRAMPOLINE 19
443 IRQ_TRAMPOLINE 1c
444 IRQ_TRAMPOLINE 4a
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500445
Kevin O'Connor74534532008-05-12 18:28:58 -0400446 ORG 0xe82e
Kevin O'Connored128492008-03-11 11:14:59 -0400447 IRQ_ENTRY_ARG 16
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500448
Kevin O'Connorc541e1b2008-06-21 12:24:14 -0400449entry_hwirq:
450 ENTRY handle_hwirq
451
Kevin O'Connor74534532008-05-12 18:28:58 -0400452 ORG 0xe987
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500453 IRQ_ENTRY 09
454
Kevin O'Connor74534532008-05-12 18:28:58 -0400455 ORG 0xec59
Kevin O'Connored128492008-03-11 11:14:59 -0400456 IRQ_ENTRY_ARG 40
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500457
Kevin O'Connor74534532008-05-12 18:28:58 -0400458 ORG 0xef57
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500459 IRQ_ENTRY 0e
460
Kevin O'Connor74534532008-05-12 18:28:58 -0400461 ORG 0xefc7
Kevin O'Connor44c631d2008-03-02 11:24:36 -0500462.include "out/floppy_dbt.proc.16.s"
463 .text
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500464
Kevin O'Connor74534532008-05-12 18:28:58 -0400465 ORG 0xefd2
Kevin O'Connored128492008-03-11 11:14:59 -0400466 IRQ_ENTRY_ARG 17
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500467
Kevin O'Connor74534532008-05-12 18:28:58 -0400468 ORG 0xf045
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500469 // XXX int 10
470 iretw
471
Kevin O'Connor74534532008-05-12 18:28:58 -0400472 ORG 0xf065
Kevin O'Connored128492008-03-11 11:14:59 -0400473 IRQ_ENTRY_ARG 10
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500474
Kevin O'Connor74534532008-05-12 18:28:58 -0400475 ORG 0xf0a4
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500476 // XXX int 1D
477 iretw
478
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500479 .globl freespace2_start, freespace2_end
480freespace2_start:
481
Kevin O'Connor74534532008-05-12 18:28:58 -0400482 ORG 0xf841
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500483freespace2_end:
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500484 jmp entry_12
485
Kevin O'Connor74534532008-05-12 18:28:58 -0400486 ORG 0xf84d
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500487 jmp entry_11
488
Kevin O'Connor74534532008-05-12 18:28:58 -0400489 ORG 0xf859
Kevin O'Connored128492008-03-11 11:14:59 -0400490 IRQ_ENTRY_ARG 15
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500491
Kevin O'Connor74534532008-05-12 18:28:58 -0400492 ORG 0xfa6e
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500493.include "out/font.proc.16.s"
494 .text
495
Kevin O'Connor74534532008-05-12 18:28:58 -0400496 ORG 0xfe6e
Kevin O'Connored128492008-03-11 11:14:59 -0400497 IRQ_ENTRY_ARG 1a
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500498
Kevin O'Connor74534532008-05-12 18:28:58 -0400499 ORG 0xfea5
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500500 IRQ_ENTRY 08
501
Kevin O'Connor74534532008-05-12 18:28:58 -0400502 ORG 0xfef3
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500503 // XXX - Initial Interrupt Vector Offsets Loaded by POST
504
Kevin O'Connor74534532008-05-12 18:28:58 -0400505 ORG 0xff00
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500506 // XXX - BIOS_COPYRIGHT_STRING
507 .ascii "(c) 2002 MandrakeSoft S.A. Written by Kevin Lawton & the Bochs team."
508
Kevin O'Connor74534532008-05-12 18:28:58 -0400509 ORG 0xff53
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500510 .globl dummy_iret_handler
511dummy_iret_handler:
512 iretw
513
Kevin O'Connor74534532008-05-12 18:28:58 -0400514 ORG 0xff54
Kevin O'Connored128492008-03-11 11:14:59 -0400515 IRQ_ENTRY_ARG 05
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500516
Kevin O'Connor74534532008-05-12 18:28:58 -0400517 ORG 0xfff0 // Power-up Entry Point
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500518 ljmpw $0xf000, $post16
519
Kevin O'Connor74534532008-05-12 18:28:58 -0400520 ORG 0xfff5
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500521 // BIOS build date
522 .ascii "06/23/99"
523
Kevin O'Connor74534532008-05-12 18:28:58 -0400524 ORG 0xfffe
Kevin O'Connor44c631d2008-03-02 11:24:36 -0500525 .byte CONFIG_MODEL_ID
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500526 .byte 0x00
527
528 .end