blob: 9fe5c71b11f15b9990e9e61c9f656eeadf7f0eed [file] [log] [blame]
Kevin O'Connorf076a3e2008-02-25 22:25:15 -05001// Rom layout and bios assembler to C interface.
2//
Kevin O'Connorf8e176c2009-05-06 23:33:32 -04003// Copyright (C) 2008,2009 Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connorf076a3e2008-02-25 22:25:15 -05004// Copyright (C) 2002 MandrakeSoft S.A.
5//
Kevin O'Connorb1b7c2a2009-01-15 20:52:58 -05006// This file may be distributed under the terms of the GNU LGPLv3 license.
Kevin O'Connorf076a3e2008-02-25 22:25:15 -05007
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -05008
9/****************************************************************
10 * Include of 16bit C code
11 ****************************************************************/
12
Kevin O'Connor74534532008-05-12 18:28:58 -040013 .code16gcc
Kevin O'Connor9e821222008-12-06 18:56:19 -050014.include "out/ccode.16.s"
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050015
Kevin O'Connorf8e176c2009-05-06 23:33:32 -040016#include "config.h" // CONFIG_*
17#include "ioport.h" // PORT_A20
18#include "bregs.h" // CR0_*
19#include "cmos.h" // CMOS_RESET_CODE
20#include "../out/asm-offsets.h" // BREGS_*
21#include "entryfuncs.S" // ENTRY_*
Kevin O'Connor74534532008-05-12 18:28:58 -040022
Kevin O'Connor1d019512008-03-11 21:21:47 -040023
24/****************************************************************
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -050025 * Call trampolines
26 ****************************************************************/
27
28// Place CPU into 32bit mode from 16bit mode.
Kevin O'Connor9caf7862009-02-27 20:14:05 -050029// Clobbers: flags, segment registers, cr0, idt/gdt
Kevin O'Connord67a7032009-01-17 19:37:26 -050030 DECLFUNC transition32
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050031transition32:
Kevin O'Connor9caf7862009-02-27 20:14:05 -050032 pushl %eax
33
Kevin O'Connorf094ba82009-04-13 19:30:27 -040034 // Disable irqs (and clear direction flag)
35 cli
36 cld
37
38 // Disable nmi
39 movl $CMOS_RESET_CODE|NMI_DISABLE_BIT, %eax
40 outb %al, $PORT_CMOS_INDEX
41 inb $PORT_CMOS_DATA, %al
42
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050043 // enable a20
Kevin O'Connord9a8b2d2008-11-16 09:17:02 -050044 inb $PORT_A20, %al
45 orb $A20_ENABLE_BIT, %al
46 outb %al, $PORT_A20
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050047
48 // Set segment descriptors
Kevin O'Connor6e5b4a42008-12-06 13:03:52 -050049 lidtw %cs:pmode_IDT_info
50 lgdtw %cs:rombios32_gdt_48
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050051
Kevin O'Connor3eac0092008-11-16 09:59:32 -050052 // Enable protected mode
53 movl %cr0, %eax
54 orl $CR0_PE, %eax
55 movl %eax, %cr0
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050056
Kevin O'Connor6e5b4a42008-12-06 13:03:52 -050057 // start 32bit protected mode code
Kevin O'Connor14927082008-11-08 19:07:49 -050058 ljmpl $SEG32_MODE32_CS, $(BUILD_BIOS_ADDR + 1f)
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050059
60 .code32
611:
62 // init data segments
Kevin O'Connor14927082008-11-08 19:07:49 -050063 movl $SEG32_MODE32_DS, %eax
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050064 movw %ax, %ds
65 movw %ax, %es
66 movw %ax, %ss
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050067 movw %ax, %fs
68 movw %ax, %gs
69
Kevin O'Connor9caf7862009-02-27 20:14:05 -050070 popl %eax
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -050071 retl
72
73// Call a 16bit function from 32bit mode.
Kevin O'Connorcb6735f2008-03-01 13:39:52 -050074// %eax = address of struct bregs
Kevin O'Connor9caf7862009-02-27 20:14:05 -050075// Clobbers: %e[bcd]x, %e[ds]i, flags, segment registers, idt/gdt
Kevin O'Connord67a7032009-01-17 19:37:26 -050076 DECLFUNC __call16_from32
77 .global __call16big_from32
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -050078__call16_from32:
79 pushl %eax
80
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050081 // restore data segment limits to 0xffff
Kevin O'Connor6e5b4a42008-12-06 13:03:52 -050082 movl $SEG32_MODE16_DS, %eax
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050083 movw %ax, %ds
84 movw %ax, %es
85 movw %ax, %ss
86 movw %ax, %fs
87 movw %ax, %gs
88
Kevin O'Connorffb81a42009-04-13 19:44:55 -040089#if CONFIG_DISABLE_A20
Kevin O'Connor1a72e2e2008-11-11 22:03:55 -050090 // disable a20
Kevin O'Connord9a8b2d2008-11-16 09:17:02 -050091 inb $PORT_A20, %al
92 andb $~A20_ENABLE_BIT, %al
93 outb %al, $PORT_A20
Kevin O'Connorffb81a42009-04-13 19:44:55 -040094#endif
Kevin O'Connor1a72e2e2008-11-11 22:03:55 -050095
96 // Jump to 16bit mode
97 ljmpw $SEG32_MODE16_CS, $1f
98
Kevin O'Connor6e5b4a42008-12-06 13:03:52 -050099__call16big_from32:
100 pushl %eax
101
102 movl $SEG32_MODE16BIG_DS, %eax
103 movw %ax, %ds
104 movw %ax, %es
105 movw %ax, %ss
106 movw %ax, %fs
107 movw %ax, %gs
108
109 ljmpl $SEG32_MODE16BIG_CS, $(BUILD_BIOS_ADDR + 1f)
110
Kevin O'Connor1a72e2e2008-11-11 22:03:55 -0500111 .code16gcc
1121:
Kevin O'Connor3eac0092008-11-16 09:59:32 -0500113 // Disable protected mode
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500114 movl %cr0, %eax
Kevin O'Connor3eac0092008-11-16 09:59:32 -0500115 andl $~CR0_PE, %eax
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500116 movl %eax, %cr0
117
118 // far jump to flush CPU queue after transition to real mode
Kevin O'Connore3677b12008-07-04 15:29:23 -0400119 ljmpw $SEG_BIOS, $2f
Kevin O'Connor21e930b2008-03-01 09:49:37 -0500120
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -05001212:
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500122 // restore IDT to normal real-mode defaults
Kevin O'Connor6e5b4a42008-12-06 13:03:52 -0500123 lidtw %cs:rmode_IDT_info
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500124
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500125 // Clear segment registers
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500126 xorw %ax, %ax
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500127 movw %ax, %fs
128 movw %ax, %gs
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500129 movw %ax, %es
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500130 movw %ax, %ds
131 movw %ax, %ss // Assume stack is in segment 0
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500132
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500133 popl %eax
Kevin O'Connor18f368e2008-03-31 21:56:04 -0400134
Kevin O'Connor0b6f2eb2009-01-17 20:57:11 -0500135 // Make call.
136 calll __call16
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500137
Kevin O'Connor0b6f2eb2009-01-17 20:57:11 -0500138 // Return via transition32
139 jmp transition32
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500140
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500141
Kevin O'Connor21e930b2008-03-01 09:49:37 -0500142// Call a 16bit function from 16bit mode with a specified cpu register state
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500143// %eax = address of struct bregs
Kevin O'Connor9caf7862009-02-27 20:14:05 -0500144// Clobbers: %e[bcd]x, %e[ds]i, flags
Kevin O'Connord67a7032009-01-17 19:37:26 -0500145 DECLFUNC __call16
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500146__call16:
Kevin O'Connor9caf7862009-02-27 20:14:05 -0500147 // Save %eax, %ebp
148 pushl %ebp
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500149 pushl %eax
150
151 // Setup for iretw call
Kevin O'Connor273e8ae2009-01-19 19:56:07 -0500152 pushw %cs
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500153 pushw $1f // return point
Kevin O'Connor952974e2008-11-16 18:14:33 -0500154 pushw BREGS_flags(%eax) // flags
155 pushl BREGS_ip(%eax) // CS:IP
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500156
157 // Load calling registers.
Kevin O'Connor952974e2008-11-16 18:14:33 -0500158 movl BREGS_edi(%eax), %edi
159 movl BREGS_esi(%eax), %esi
Kevin O'Connor7da210c2009-05-16 23:57:08 -0400160 movl BREGS_ebp(%eax), %ebp
Kevin O'Connor952974e2008-11-16 18:14:33 -0500161 movl BREGS_ebx(%eax), %ebx
162 movl BREGS_edx(%eax), %edx
163 movl BREGS_ecx(%eax), %ecx
164 movw BREGS_es(%eax), %es
165 movw BREGS_ds(%eax), %ds
166 movl %ss:BREGS_eax(%eax), %eax
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500167
168 // Invoke call
169 iretw // XXX - just do a lcalll
1701:
171 // Store flags, eax, ecx
172 pushfw
173 pushl %eax
174 movl 0x06(%esp), %eax
Kevin O'Connor952974e2008-11-16 18:14:33 -0500175 movl %ecx, %ss:BREGS_ecx(%eax)
176 movw %ds, %ss:BREGS_ds(%eax)
Kevin O'Connorcbbb6672008-03-08 13:04:10 -0500177 movw %ss, %cx
Kevin O'Connor952974e2008-11-16 18:14:33 -0500178 movw %cx, %ds // Restore %ds == %ss
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500179 popl %ecx
Kevin O'Connor952974e2008-11-16 18:14:33 -0500180 movl %ecx, BREGS_eax(%eax)
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500181 popw %cx
Kevin O'Connor952974e2008-11-16 18:14:33 -0500182 movw %cx, BREGS_flags(%eax)
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500183
184 // Store remaining registers
Kevin O'Connor952974e2008-11-16 18:14:33 -0500185 movw %es, BREGS_es(%eax)
186 movl %edi, BREGS_edi(%eax)
187 movl %esi, BREGS_esi(%eax)
Kevin O'Connor7da210c2009-05-16 23:57:08 -0400188 movl %ebp, BREGS_ebp(%eax)
Kevin O'Connor952974e2008-11-16 18:14:33 -0500189 movl %ebx, BREGS_ebx(%eax)
190 movl %edx, BREGS_edx(%eax)
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500191
Kevin O'Connor9caf7862009-02-27 20:14:05 -0500192 // Remove %eax, restore %ebp
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500193 popl %eax
Kevin O'Connor9caf7862009-02-27 20:14:05 -0500194 popl %ebp
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500195
196 retl
197
Kevin O'Connor79dde652009-04-13 19:26:43 -0400198// IRQ trampolines
199 .macro IRQ_TRAMPOLINE num
200 DECLFUNC irq_trampoline_0x\num
201 irq_trampoline_0x\num :
202 int $0x\num
203 lretw
204 .endm
205
206 IRQ_TRAMPOLINE 10
207 IRQ_TRAMPOLINE 13
208 IRQ_TRAMPOLINE 15
209 IRQ_TRAMPOLINE 16
210 IRQ_TRAMPOLINE 18
211 IRQ_TRAMPOLINE 19
212
213
214/****************************************************************
215 * POST entry point
216 ****************************************************************/
217
218 DECLFUNC entry_post
219entry_post:
220 // Enable cache
221 movl %cr0, %eax
222 andl $~(CR0_CD|CR0_NW), %eax
223 movl %eax, %cr0
224
225 // Disable interrupts
226 cli
227 cld
228
229 // Check for restart indicator.
230 movl $CMOS_RESET_CODE|NMI_DISABLE_BIT, %eax
231 outb %al, $PORT_CMOS_INDEX
232 inb $PORT_CMOS_DATA, %al
233 cmpb $0x0, %al
234 jnz 1f
235
236 // Normal entry point
237 ENTRY_INTO32 _code32__start
238
239 // Entry point when a post call looks like a resume.
2401:
241 // Save old shutdown status.
242 movl %eax, %ebx
243
244 // Clear shutdown status register.
245 movl $CMOS_RESET_CODE|NMI_DISABLE_BIT, %eax
246 outb %al, $PORT_CMOS_INDEX
247 xorl %eax, %eax
248 outb %al, $PORT_CMOS_DATA
249
250 // Use a stack in EBDA
251 movw $SEG_BDA, %ax
252 movw %ax, %ds
253 movw BDA_ebda_seg, %ax
Kevin O'Connor49553a42009-05-17 10:31:34 -0400254
255 cmpw $EBDA_SEGMENT_START, %ax
256 jle 2f
257 // EBDA segment doesn't look valid - use startup value.
258 movw $EBDA_SEGMENT_START, %ax
259
2602: movw %ax, %ds
Kevin O'Connor79dde652009-04-13 19:26:43 -0400261 movw %ax, %ss
262 movl $EBDA_OFFSET_TOP_STACK, %esp
263
264 // Call handler.
265 movl %ebx, %eax
266 jmp handle_resume
267
268
269/****************************************************************
270 * Misc. entry points.
271 ****************************************************************/
272
273// PnP entry points
Kevin O'Connord67a7032009-01-17 19:37:26 -0500274 DECLFUNC entry_pnp_real
275 .global entry_pnp_prot
Kevin O'Connor0c3068d2008-12-21 17:51:36 -0500276entry_pnp_prot:
277 pushl %esp
278 jmp 1f
279entry_pnp_real:
280 pushl %esp // Backup %esp, then clear high bits
281 movzwl %sp, %esp
2821:
283 pushfl // Save registers clobbered by C code
284 pushl %eax
285 pushl %ecx
286 pushl %edx
287 pushw %es
288 pushw %ds
289 movw %ss, %cx // Move %ss to %ds
290 movw %cx, %ds
291 lea 28(%esp), %eax // %eax points to start of u16 args
292 calll handle_pnp
293 movw %ax, 12(%esp) // Modify %eax to return %ax
294 popw %ds
295 popw %es
296 popl %edx
297 popl %ecx
298 popl %eax
299 popfl
300 popl %esp
301 lretw
302
Kevin O'Connor79dde652009-04-13 19:26:43 -0400303// APM entry points
Kevin O'Connord67a7032009-01-17 19:37:26 -0500304 DECLFUNC apm16protected_entry
Kevin O'Connor1d019512008-03-11 21:21:47 -0400305apm16protected_entry:
306 pushfw // save flags
307 pushl %eax // dummy
308 ENTRY_ARG handle_1553
Kevin O'Connorb3c28be2008-06-08 13:34:43 -0400309 addw $4, %sp // pop dummy
Kevin O'Connor1d019512008-03-11 21:21:47 -0400310 popfw // restore flags
311 lretw
312
313 .code32
Kevin O'Connord67a7032009-01-17 19:37:26 -0500314 DECLFUNC apm32protected_entry
Kevin O'Connor1d019512008-03-11 21:21:47 -0400315apm32protected_entry:
Kevin O'Connor68296e82008-03-13 21:33:26 -0400316 pushfw
317 pushw %cs // Setup for long jump to 16bit mode
318 pushw $1f
Kevin O'Connor0fae9e12008-06-07 14:51:14 -0400319 addw $8, 2(%esp)
Kevin O'Connor68296e82008-03-13 21:33:26 -0400320 ljmpw *(%esp)
321 .code16gcc
3221:
Kevin O'Connorb3c28be2008-06-08 13:34:43 -0400323 ENTRY_ARG_ESP handle_1553
Kevin O'Connor68296e82008-03-13 21:33:26 -0400324
325 movw $2f,(%esp) // Setup for long jump back to 32bit mode
Kevin O'Connor0fae9e12008-06-07 14:51:14 -0400326 subw $8, 2(%esp)
Kevin O'Connor68296e82008-03-13 21:33:26 -0400327 ljmpw *(%esp)
328 .code32
3292:
Kevin O'Connor1d019512008-03-11 21:21:47 -0400330 addl $4, %esp // pop call address
331 popfw
332 lretl
Kevin O'Connoree4f9ff2008-07-05 21:19:10 -0400333
334// 32bit elf entry point
Kevin O'Connord67a7032009-01-17 19:37:26 -0500335 DECLFUNC post32
Kevin O'Connoree4f9ff2008-07-05 21:19:10 -0400336post32:
337 cli
338 cld
339 lidtl (BUILD_BIOS_ADDR + pmode_IDT_info)
340 lgdtl (BUILD_BIOS_ADDR + rombios32_gdt_48)
Kevin O'Connore0504b02009-04-13 19:32:51 -0400341 movl $SEG32_MODE32_DS, %eax
342 movw %ax, %ds
343 movw %ax, %es
344 movw %ax, %fs
345 movw %ax, %gs
346 movw %ax, %ss
Kevin O'Connoree4f9ff2008-07-05 21:19:10 -0400347 movl $BUILD_STACK_ADDR, %esp
Kevin O'Connor14927082008-11-08 19:07:49 -0500348 ljmpl $SEG32_MODE32_CS, $_code32__start
Kevin O'Connoree4f9ff2008-07-05 21:19:10 -0400349
Kevin O'Connor1d019512008-03-11 21:21:47 -0400350 .code16gcc
Kevin O'Connor1d019512008-03-11 21:21:47 -0400351
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500352
353/****************************************************************
Kevin O'Connorc5b50362008-12-18 21:56:41 -0500354 * Interrupt entry points
355 ****************************************************************/
356
Kevin O'Connor9f193b92009-05-16 23:31:27 -0400357 // Define an entry point for an interrupt (no args passed).
358 .macro IRQ_ENTRY num
359 .global entry_\num
360 entry_\num :
361 pushl $ handle_\num
362 jmp irqentry
363 .endm
364
365 // Define an entry point for an interrupt (can read/modify args).
366 .macro IRQ_ENTRY_ARG num
367 .global entry_\num
368 entry_\num :
369 pushl $ handle_\num
370 jmp irqentryarg
371 .endm
372
373 // Macros that put each handler into its own section
374 .macro DECL_IRQ_ENTRY num
375 DECLFUNC entry_\num
376 IRQ_ENTRY \num
377 .endm
378 .macro DECL_IRQ_ENTRY_ARG num
379 DECLFUNC entry_\num
380 IRQ_ENTRY_ARG \num
381 .endm
382
383 // Main entry point for interrupts without args
384 DECLFUNC irqentry
385irqentry:
386 ENTRY_ST
387 iretw
388
389 // Main entry point for interrupts with args
390 DECLFUNC irqentry
391irqentryarg:
392 ENTRY_ARG_ST
393 iretw
394
Kevin O'Connord67a7032009-01-17 19:37:26 -0500395 DECL_IRQ_ENTRY_ARG 13
Kevin O'Connord67a7032009-01-17 19:37:26 -0500396 DECL_IRQ_ENTRY 76
Kevin O'Connord67a7032009-01-17 19:37:26 -0500397 DECL_IRQ_ENTRY 70
398 DECL_IRQ_ENTRY 74
399 DECL_IRQ_ENTRY 75
400 DECL_IRQ_ENTRY hwpic1
401 DECL_IRQ_ENTRY hwpic2
402
Kevin O'Connor4ebc0b72009-03-01 12:31:57 -0500403 // int 18/19 are special - they reset stack and call into 32bit mode.
Kevin O'Connord67a7032009-01-17 19:37:26 -0500404 DECLFUNC entry_19
405entry_19:
Kevin O'Connor4ebc0b72009-03-01 12:31:57 -0500406 ENTRY_INTO32 _code32_handle_19
Kevin O'Connord67a7032009-01-17 19:37:26 -0500407
408 DECLFUNC entry_18
409entry_18:
Kevin O'Connor4ebc0b72009-03-01 12:31:57 -0500410 ENTRY_INTO32 _code32_handle_18
Kevin O'Connord67a7032009-01-17 19:37:26 -0500411
412
413/****************************************************************
414 * Fixed position entry points
415 ****************************************************************/
416
417 // Specify a location in the fixed part of bios area.
418 .macro ORG addr
419 .section .fixedaddr.\addr
420 .endm
421
422 ORG 0xe05b
423entry_post_official:
424 jmp entry_post
425
Kevin O'Connorc5b50362008-12-18 21:56:41 -0500426 ORG 0xe2c3
Kevin O'Connor75f49b32009-03-07 00:07:24 -0500427 IRQ_ENTRY 02
Kevin O'Connorc5b50362008-12-18 21:56:41 -0500428
Kevin O'Connor74534532008-05-12 18:28:58 -0400429 ORG 0xe3fe
Kevin O'Connorb4f0e892008-12-13 18:33:05 -0500430 .global entry_13_official
431entry_13_official:
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500432 jmp entry_13
433
Kevin O'Connor30853762009-01-17 18:49:20 -0500434 // 0xe401 - OldFDPT in disk.c
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500435
Kevin O'Connor74534532008-05-12 18:28:58 -0400436 ORG 0xe6f2
Kevin O'Connorb4f0e892008-12-13 18:33:05 -0500437 .global entry_19_official
438entry_19_official:
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500439 jmp entry_19
440
Kevin O'Connor30853762009-01-17 18:49:20 -0500441 // 0xe6f5 - BIOS_CONFIG_TABLE in misc.c
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500442
Kevin O'Connor30853762009-01-17 18:49:20 -0500443 // 0xe729 - BaudTable in serial.c
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500444
Kevin O'Connor74534532008-05-12 18:28:58 -0400445 ORG 0xe739
Kevin O'Connored128492008-03-11 11:14:59 -0400446 IRQ_ENTRY_ARG 14
447
Kevin O'Connorb4f0e892008-12-13 18:33:05 -0500448 ORG 0xe82e
449 IRQ_ENTRY_ARG 16
450
451 ORG 0xe987
452 IRQ_ENTRY 09
453
454 ORG 0xec59
455 IRQ_ENTRY_ARG 40
456
457 ORG 0xef57
458 IRQ_ENTRY 0e
459
Kevin O'Connor30853762009-01-17 18:49:20 -0500460 // 0xefc7 - diskette_param_table in floppy.c
Kevin O'Connorb4f0e892008-12-13 18:33:05 -0500461
462 ORG 0xefd2
463 IRQ_ENTRY_ARG 17
464
465 ORG 0xf045
Kevin O'Connord67a7032009-01-17 19:37:26 -0500466entry_10_0x0f:
Kevin O'Connorb4f0e892008-12-13 18:33:05 -0500467 // XXX - INT 10 Functions 0-Fh Entry Point
468 iretw
469
470 ORG 0xf065
471 IRQ_ENTRY_ARG 10
472
Kevin O'Connor30853762009-01-17 18:49:20 -0500473 // 0xf0a4 - VideoParams in misc.c
Kevin O'Connorb4f0e892008-12-13 18:33:05 -0500474
Kevin O'Connorb4f0e892008-12-13 18:33:05 -0500475 ORG 0xf841
Kevin O'Connor9f193b92009-05-16 23:31:27 -0400476 IRQ_ENTRY_ARG 12
Kevin O'Connorb4f0e892008-12-13 18:33:05 -0500477
478 ORG 0xf84d
Kevin O'Connor9f193b92009-05-16 23:31:27 -0400479 IRQ_ENTRY_ARG 11
Kevin O'Connorb4f0e892008-12-13 18:33:05 -0500480
481 ORG 0xf859
482 IRQ_ENTRY_ARG 15
483
Kevin O'Connor30853762009-01-17 18:49:20 -0500484 // 0xfa6e - vgafont8 in font.c
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500485
Kevin O'Connor74534532008-05-12 18:28:58 -0400486 ORG 0xfe6e
Kevin O'Connored128492008-03-11 11:14:59 -0400487 IRQ_ENTRY_ARG 1a
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500488
Kevin O'Connor74534532008-05-12 18:28:58 -0400489 ORG 0xfea5
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500490 IRQ_ENTRY 08
491
Kevin O'Connor30853762009-01-17 18:49:20 -0500492 // 0xfef3 - InitVectors in misc.c
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500493
Kevin O'Connor30853762009-01-17 18:49:20 -0500494 // 0xff00 - BiosCopyright in misc.c
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500495
Kevin O'Connor74534532008-05-12 18:28:58 -0400496 ORG 0xff53
Kevin O'Connord67a7032009-01-17 19:37:26 -0500497 .global entry_iret_official
498entry_iret_official:
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500499 iretw
500
Kevin O'Connor74534532008-05-12 18:28:58 -0400501 ORG 0xff54
Kevin O'Connored128492008-03-11 11:14:59 -0400502 IRQ_ENTRY_ARG 05
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500503
Kevin O'Connor74534532008-05-12 18:28:58 -0400504 ORG 0xfff0 // Power-up Entry Point
Kevin O'Connor3f168b62008-11-29 13:22:29 -0500505 .global reset_vector
506reset_vector:
Kevin O'Connord67a7032009-01-17 19:37:26 -0500507 ljmpw $SEG_BIOS, $entry_post_official
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500508
Kevin O'Connor30853762009-01-17 18:49:20 -0500509 // 0xfff5 - BiosDate in misc.c
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500510
Kevin O'Connor30853762009-01-17 18:49:20 -0500511 // 0xfffe - BiosModelId in misc.c
Kevin O'Connore3677b12008-07-04 15:29:23 -0400512
Kevin O'Connor30853762009-01-17 18:49:20 -0500513 // 0xffff - BiosChecksum in misc.c
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500514
515 .end