blob: 736dc9b31be8fc4a9e96736200e08e74014ffb71 [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
160 movl BREGS_ebx(%eax), %ebx
161 movl BREGS_edx(%eax), %edx
162 movl BREGS_ecx(%eax), %ecx
163 movw BREGS_es(%eax), %es
164 movw BREGS_ds(%eax), %ds
165 movl %ss:BREGS_eax(%eax), %eax
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500166
167 // Invoke call
168 iretw // XXX - just do a lcalll
1691:
170 // Store flags, eax, ecx
171 pushfw
172 pushl %eax
173 movl 0x06(%esp), %eax
Kevin O'Connor952974e2008-11-16 18:14:33 -0500174 movl %ecx, %ss:BREGS_ecx(%eax)
175 movw %ds, %ss:BREGS_ds(%eax)
Kevin O'Connorcbbb6672008-03-08 13:04:10 -0500176 movw %ss, %cx
Kevin O'Connor952974e2008-11-16 18:14:33 -0500177 movw %cx, %ds // Restore %ds == %ss
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500178 popl %ecx
Kevin O'Connor952974e2008-11-16 18:14:33 -0500179 movl %ecx, BREGS_eax(%eax)
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500180 popw %cx
Kevin O'Connor952974e2008-11-16 18:14:33 -0500181 movw %cx, BREGS_flags(%eax)
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500182
183 // Store remaining registers
Kevin O'Connor952974e2008-11-16 18:14:33 -0500184 movw %es, BREGS_es(%eax)
185 movl %edi, BREGS_edi(%eax)
186 movl %esi, BREGS_esi(%eax)
187 movl %ebx, BREGS_ebx(%eax)
188 movl %edx, BREGS_edx(%eax)
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500189
Kevin O'Connor9caf7862009-02-27 20:14:05 -0500190 // Remove %eax, restore %ebp
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500191 popl %eax
Kevin O'Connor9caf7862009-02-27 20:14:05 -0500192 popl %ebp
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500193
194 retl
195
Kevin O'Connor79dde652009-04-13 19:26:43 -0400196// IRQ trampolines
197 .macro IRQ_TRAMPOLINE num
198 DECLFUNC irq_trampoline_0x\num
199 irq_trampoline_0x\num :
200 int $0x\num
201 lretw
202 .endm
203
204 IRQ_TRAMPOLINE 10
205 IRQ_TRAMPOLINE 13
206 IRQ_TRAMPOLINE 15
207 IRQ_TRAMPOLINE 16
208 IRQ_TRAMPOLINE 18
209 IRQ_TRAMPOLINE 19
210
211
212/****************************************************************
213 * POST entry point
214 ****************************************************************/
215
216 DECLFUNC entry_post
217entry_post:
218 // Enable cache
219 movl %cr0, %eax
220 andl $~(CR0_CD|CR0_NW), %eax
221 movl %eax, %cr0
222
223 // Disable interrupts
224 cli
225 cld
226
227 // Check for restart indicator.
228 movl $CMOS_RESET_CODE|NMI_DISABLE_BIT, %eax
229 outb %al, $PORT_CMOS_INDEX
230 inb $PORT_CMOS_DATA, %al
231 cmpb $0x0, %al
232 jnz 1f
233
234 // Normal entry point
235 ENTRY_INTO32 _code32__start
236
237 // Entry point when a post call looks like a resume.
2381:
239 // Save old shutdown status.
240 movl %eax, %ebx
241
242 // Clear shutdown status register.
243 movl $CMOS_RESET_CODE|NMI_DISABLE_BIT, %eax
244 outb %al, $PORT_CMOS_INDEX
245 xorl %eax, %eax
246 outb %al, $PORT_CMOS_DATA
247
248 // Use a stack in EBDA
249 movw $SEG_BDA, %ax
250 movw %ax, %ds
251 movw BDA_ebda_seg, %ax
252 // XXX - should verify ebda_seg looks sane.
253 movw %ax, %ds
254 movw %ax, %ss
255 movl $EBDA_OFFSET_TOP_STACK, %esp
256
257 // Call handler.
258 movl %ebx, %eax
259 jmp handle_resume
260
261
262/****************************************************************
263 * Misc. entry points.
264 ****************************************************************/
265
266// PnP entry points
Kevin O'Connord67a7032009-01-17 19:37:26 -0500267 DECLFUNC entry_pnp_real
268 .global entry_pnp_prot
Kevin O'Connor0c3068d2008-12-21 17:51:36 -0500269entry_pnp_prot:
270 pushl %esp
271 jmp 1f
272entry_pnp_real:
273 pushl %esp // Backup %esp, then clear high bits
274 movzwl %sp, %esp
2751:
276 pushfl // Save registers clobbered by C code
277 pushl %eax
278 pushl %ecx
279 pushl %edx
280 pushw %es
281 pushw %ds
282 movw %ss, %cx // Move %ss to %ds
283 movw %cx, %ds
284 lea 28(%esp), %eax // %eax points to start of u16 args
285 calll handle_pnp
286 movw %ax, 12(%esp) // Modify %eax to return %ax
287 popw %ds
288 popw %es
289 popl %edx
290 popl %ecx
291 popl %eax
292 popfl
293 popl %esp
294 lretw
295
Kevin O'Connor79dde652009-04-13 19:26:43 -0400296// APM entry points
Kevin O'Connord67a7032009-01-17 19:37:26 -0500297 DECLFUNC apm16protected_entry
Kevin O'Connor1d019512008-03-11 21:21:47 -0400298apm16protected_entry:
299 pushfw // save flags
300 pushl %eax // dummy
301 ENTRY_ARG handle_1553
Kevin O'Connorb3c28be2008-06-08 13:34:43 -0400302 addw $4, %sp // pop dummy
Kevin O'Connor1d019512008-03-11 21:21:47 -0400303 popfw // restore flags
304 lretw
305
306 .code32
Kevin O'Connord67a7032009-01-17 19:37:26 -0500307 DECLFUNC apm32protected_entry
Kevin O'Connor1d019512008-03-11 21:21:47 -0400308apm32protected_entry:
Kevin O'Connor68296e82008-03-13 21:33:26 -0400309 pushfw
310 pushw %cs // Setup for long jump to 16bit mode
311 pushw $1f
Kevin O'Connor0fae9e12008-06-07 14:51:14 -0400312 addw $8, 2(%esp)
Kevin O'Connor68296e82008-03-13 21:33:26 -0400313 ljmpw *(%esp)
314 .code16gcc
3151:
Kevin O'Connorb3c28be2008-06-08 13:34:43 -0400316 ENTRY_ARG_ESP handle_1553
Kevin O'Connor68296e82008-03-13 21:33:26 -0400317
318 movw $2f,(%esp) // Setup for long jump back to 32bit mode
Kevin O'Connor0fae9e12008-06-07 14:51:14 -0400319 subw $8, 2(%esp)
Kevin O'Connor68296e82008-03-13 21:33:26 -0400320 ljmpw *(%esp)
321 .code32
3222:
Kevin O'Connor1d019512008-03-11 21:21:47 -0400323 addl $4, %esp // pop call address
324 popfw
325 lretl
Kevin O'Connoree4f9ff2008-07-05 21:19:10 -0400326
327// 32bit elf entry point
Kevin O'Connord67a7032009-01-17 19:37:26 -0500328 DECLFUNC post32
Kevin O'Connoree4f9ff2008-07-05 21:19:10 -0400329post32:
330 cli
331 cld
332 lidtl (BUILD_BIOS_ADDR + pmode_IDT_info)
333 lgdtl (BUILD_BIOS_ADDR + rombios32_gdt_48)
Kevin O'Connore0504b02009-04-13 19:32:51 -0400334 movl $SEG32_MODE32_DS, %eax
335 movw %ax, %ds
336 movw %ax, %es
337 movw %ax, %fs
338 movw %ax, %gs
339 movw %ax, %ss
Kevin O'Connoree4f9ff2008-07-05 21:19:10 -0400340 movl $BUILD_STACK_ADDR, %esp
Kevin O'Connor14927082008-11-08 19:07:49 -0500341 ljmpl $SEG32_MODE32_CS, $_code32__start
Kevin O'Connoree4f9ff2008-07-05 21:19:10 -0400342
Kevin O'Connor1d019512008-03-11 21:21:47 -0400343 .code16gcc
Kevin O'Connor1d019512008-03-11 21:21:47 -0400344
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -0500345
346/****************************************************************
Kevin O'Connorc5b50362008-12-18 21:56:41 -0500347 * Interrupt entry points
348 ****************************************************************/
349
Kevin O'Connord67a7032009-01-17 19:37:26 -0500350 DECL_IRQ_ENTRY_ARG 13
351 DECL_IRQ_ENTRY_ARG 12
352 DECL_IRQ_ENTRY_ARG 11
353 DECL_IRQ_ENTRY 76
Kevin O'Connord67a7032009-01-17 19:37:26 -0500354 DECL_IRQ_ENTRY 70
355 DECL_IRQ_ENTRY 74
356 DECL_IRQ_ENTRY 75
357 DECL_IRQ_ENTRY hwpic1
358 DECL_IRQ_ENTRY hwpic2
359
Kevin O'Connor4ebc0b72009-03-01 12:31:57 -0500360 // int 18/19 are special - they reset stack and call into 32bit mode.
Kevin O'Connord67a7032009-01-17 19:37:26 -0500361 DECLFUNC entry_19
362entry_19:
Kevin O'Connor4ebc0b72009-03-01 12:31:57 -0500363 ENTRY_INTO32 _code32_handle_19
Kevin O'Connord67a7032009-01-17 19:37:26 -0500364
365 DECLFUNC entry_18
366entry_18:
Kevin O'Connor4ebc0b72009-03-01 12:31:57 -0500367 ENTRY_INTO32 _code32_handle_18
Kevin O'Connord67a7032009-01-17 19:37:26 -0500368
369
370/****************************************************************
371 * Fixed position entry points
372 ****************************************************************/
373
374 // Specify a location in the fixed part of bios area.
375 .macro ORG addr
376 .section .fixedaddr.\addr
377 .endm
378
379 ORG 0xe05b
380entry_post_official:
381 jmp entry_post
382
Kevin O'Connorc5b50362008-12-18 21:56:41 -0500383 ORG 0xe2c3
Kevin O'Connor75f49b32009-03-07 00:07:24 -0500384 IRQ_ENTRY 02
Kevin O'Connorc5b50362008-12-18 21:56:41 -0500385
Kevin O'Connor74534532008-05-12 18:28:58 -0400386 ORG 0xe3fe
Kevin O'Connorb4f0e892008-12-13 18:33:05 -0500387 .global entry_13_official
388entry_13_official:
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500389 jmp entry_13
390
Kevin O'Connor30853762009-01-17 18:49:20 -0500391 // 0xe401 - OldFDPT in disk.c
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500392
Kevin O'Connor74534532008-05-12 18:28:58 -0400393 ORG 0xe6f2
Kevin O'Connorb4f0e892008-12-13 18:33:05 -0500394 .global entry_19_official
395entry_19_official:
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500396 jmp entry_19
397
Kevin O'Connor30853762009-01-17 18:49:20 -0500398 // 0xe6f5 - BIOS_CONFIG_TABLE in misc.c
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500399
Kevin O'Connor30853762009-01-17 18:49:20 -0500400 // 0xe729 - BaudTable in serial.c
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500401
Kevin O'Connor74534532008-05-12 18:28:58 -0400402 ORG 0xe739
Kevin O'Connored128492008-03-11 11:14:59 -0400403 IRQ_ENTRY_ARG 14
404
Kevin O'Connorb4f0e892008-12-13 18:33:05 -0500405 ORG 0xe82e
406 IRQ_ENTRY_ARG 16
407
408 ORG 0xe987
409 IRQ_ENTRY 09
410
411 ORG 0xec59
412 IRQ_ENTRY_ARG 40
413
414 ORG 0xef57
415 IRQ_ENTRY 0e
416
Kevin O'Connor30853762009-01-17 18:49:20 -0500417 // 0xefc7 - diskette_param_table in floppy.c
Kevin O'Connorb4f0e892008-12-13 18:33:05 -0500418
419 ORG 0xefd2
420 IRQ_ENTRY_ARG 17
421
422 ORG 0xf045
Kevin O'Connord67a7032009-01-17 19:37:26 -0500423entry_10_0x0f:
Kevin O'Connorb4f0e892008-12-13 18:33:05 -0500424 // XXX - INT 10 Functions 0-Fh Entry Point
425 iretw
426
427 ORG 0xf065
428 IRQ_ENTRY_ARG 10
429
Kevin O'Connor30853762009-01-17 18:49:20 -0500430 // 0xf0a4 - VideoParams in misc.c
Kevin O'Connorb4f0e892008-12-13 18:33:05 -0500431
Kevin O'Connorb4f0e892008-12-13 18:33:05 -0500432 ORG 0xf841
Kevin O'Connorb4f0e892008-12-13 18:33:05 -0500433 .global entry_12_official
434entry_12_official:
435 jmp entry_12
436
437 ORG 0xf84d
438 .global entry_11_official
439entry_11_official:
440 jmp entry_11
441
442 ORG 0xf859
443 IRQ_ENTRY_ARG 15
444
Kevin O'Connor30853762009-01-17 18:49:20 -0500445 // 0xfa6e - vgafont8 in font.c
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500446
Kevin O'Connor74534532008-05-12 18:28:58 -0400447 ORG 0xfe6e
Kevin O'Connored128492008-03-11 11:14:59 -0400448 IRQ_ENTRY_ARG 1a
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500449
Kevin O'Connor74534532008-05-12 18:28:58 -0400450 ORG 0xfea5
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500451 IRQ_ENTRY 08
452
Kevin O'Connor30853762009-01-17 18:49:20 -0500453 // 0xfef3 - InitVectors in misc.c
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500454
Kevin O'Connor30853762009-01-17 18:49:20 -0500455 // 0xff00 - BiosCopyright in misc.c
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500456
Kevin O'Connor74534532008-05-12 18:28:58 -0400457 ORG 0xff53
Kevin O'Connord67a7032009-01-17 19:37:26 -0500458 .global entry_iret_official
459entry_iret_official:
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500460 iretw
461
Kevin O'Connor74534532008-05-12 18:28:58 -0400462 ORG 0xff54
Kevin O'Connored128492008-03-11 11:14:59 -0400463 IRQ_ENTRY_ARG 05
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500464
Kevin O'Connor74534532008-05-12 18:28:58 -0400465 ORG 0xfff0 // Power-up Entry Point
Kevin O'Connor3f168b62008-11-29 13:22:29 -0500466 .global reset_vector
467reset_vector:
Kevin O'Connord67a7032009-01-17 19:37:26 -0500468 ljmpw $SEG_BIOS, $entry_post_official
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500469
Kevin O'Connor30853762009-01-17 18:49:20 -0500470 // 0xfff5 - BiosDate in misc.c
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500471
Kevin O'Connor30853762009-01-17 18:49:20 -0500472 // 0xfffe - BiosModelId in misc.c
Kevin O'Connore3677b12008-07-04 15:29:23 -0400473
Kevin O'Connor30853762009-01-17 18:49:20 -0500474 // 0xffff - BiosChecksum in misc.c
Kevin O'Connorf076a3e2008-02-25 22:25:15 -0500475
476 .end