1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825
|
/*
* $Id: entry.S,v 1.168 2009-07-24 14:56:12 vrsieh Exp $
*
* Copyright (C) 2004-2009 FAUmachine Team <info@faumachine.org>.
* This program is free software. You can redistribute it and/or modify it
* under the terms of the GNU General Public License, either version 2 of
* the License, or (at your option) any later version. See COPYING.
*/
#include "build_config.h"
#include "libsys.h"
#include "compiler.h"
/* FIXME JOSEF: move gdt stuff to protected_mode.c */
.section .text, "ax"
.code16gcc
/* FIXME */
#ifndef CONFIG_80286_SUPPORT
#define OFF_WRT_CS(reg, lin_addr) \
/* Calculate offset to lin addr */ \
xorl %reg, %reg; \
movl %cs, %reg; \
shll $4, %reg; \
subl $lin_addr, %reg; \
negl %reg;
#else
#define WRT_REG(reg, addr) \
movw $addr, %reg;
#endif
#define PCI_ADDR(bus, dev, func) \
(((bus) << 16) | ((dev) << 11) | ((func) << 8))
#define PCICONF_ADDR 0x0cf8
#define PCICONF_DATA 0x0cfc
/* Pushes all registers on stack and calls the bios
* function with a pointer to the registers
*/
#ifndef CONFIG_80286_SUPPORT
#define CALL() \
/* pushl %eax; */ \
pushl %ebx; \
pushl %ecx; \
pushl %edx; \
pushw %bp; \
pushw %si; \
pushw %di; \
\
pushw %ds; \
pushw %es; \
\
movw %ss, %dx; \
movw %dx, %ds; \
movw %dx, %es; \
\
movl %esp, %edx; \
pushl %edx; \
\
andl $0x0000ffff, %esp; \
andl $0x0000ffff, %edx; \
pushl %edx; \
\
lcallw *%cs:(%eax); \
\
addw $4, %sp; \
\
popl %edx; \
movl %edx, %esp; \
\
popw %es; \
popw %ds; \
\
popw %di; \
popw %si; \
popw %bp; \
popl %edx; \
popl %ecx; \
popl %ebx; \
/* popl %eax */
#else
#define CALL() \
/* pushw %es; */ \
/* pushw %bx; */ \
pushw %ax; \
pushw %cx; \
pushw %dx; \
pushw %bp; \
pushw %si; \
pushw %di; \
\
pushw %ds; \
\
movw %ss, %dx; \
movw %dx, %ds; \
\
pushw %es; \
pushw %bx; \
\
movw %sp, %bp; \
\
lcallw *%ss:(%bp); \
\
addw $4, %sp; \
\
popw %ds; \
\
popw %di; \
popw %si; \
popw %bp; \
popw %dx; \
popw %cx; \
popw %ax;
/* popw %bx */
/* popw %es; */
#endif
/* Saves registers on stack which might be modified
* by the C-function and calls it with no parameters
*/
#ifndef CONFIG_80286_SUPPORT
#define IRQCALL() \
/* pushl %eax; */ \
pushl %ecx; \
pushl %edx; \
\
pushw %ds; \
pushw %es; \
\
movw %ss, %dx; \
movw %dx, %ds; \
movw %dx, %es; \
\
movl %esp, %edx; \
pushl %edx; \
\
andl $0x0000ffff, %esp; \
\
lcallw *%cs:(%eax); \
\
popl %edx; \
movl %edx, %esp; \
\
popw %es; \
popw %ds; \
\
popl %edx; \
popl %ecx; \
/* popl %eax */
#else
#define IRQCALL() \
/* pushw %es; */ \
/* pushw %bx; */ \
pushw %ax; \
pushw %cx; \
pushw %dx; \
pushw %bp; \
\
pushw %ds; \
\
movw %ss, %dx; \
movw %dx, %ds; \
\
pushw %es; \
pushw %bx; \
\
movw %sp, %bp; \
\
lcallw *%ss:(%bp); \
\
addw $4, %sp; \
\
popw %ds; \
\
popw %bp; \
popw %dx; \
popw %cx; \
popw %ax;
/* popw %bx */
/* popw %es; */
#endif
#ifndef CONFIG_80286_SUPPORT
#define CALLPM() \
/* pushl %eax; */ \
pushl %ebx; \
pushl %ecx; \
pushl %edx; \
pushw %bp; \
pushw %si; \
pushw %di; \
\
pushw %ds; \
pushw %es; \
\
movw %ss, %dx; \
movw %dx, %ds; \
movw %dx, %es; \
\
movl %esp, %edx; \
pushl %edx; \
call *%eax; \
addw $4, %sp; \
\
popw %es; \
popw %ds; \
\
popw %di; \
popw %si; \
popw %bp; \
popl %edx; \
popl %ecx; \
popl %ebx; \
/* popl %eax */
#else
#define CALLPM() \
/* pushw %es; */ \
/* pushw %bx; */ \
pushw %ax; \
pushw %cx; \
pushw %dx; \
pushw %bp; \
pushw %si; \
pushw %di; \
\
pushw %ds; \
\
movw %ss, %dx; \
movw %dx, %ds; \
\
pushw %es; \
pushw %bx; \
\
movw %sp, %bp; \
\
lcallw *%ss:(%bp); \
\
addw $4, %sp; \
\
popw %ds; \
\
popw %di; \
popw %si; \
popw %bp; \
popw %dx; \
popw %cx; \
popw %ax;
/* popw %bx */
/* popw %es; */
#endif
#ifndef CONFIG_80286_SUPPORT
#define FAR_DATA_DEC(hl_handler) \
far_data_ ## hl_handler: \
.word OFF_ ## hl_handler; \
.word SEG_ ## hl_handler;
#else
#define FAR_DATA_DEC(hl_handler)
#endif
#ifndef CONFIG_80286_SUPPORT
#define IRQ_HANDLER_STUB(name, hl_handler) \
_C_LABEL(name): .globl _C_LABEL(name); \
pushl %eax; \
OFF_WRT_CS(eax, far_data_ ## hl_handler) \
jmp irq_common;
#else
#define IRQ_HANDLER_STUB(name, hl_handler) \
_C_LABEL(name): .globl _C_LABEL(name); \
pushw %es; \
pushw %bx; \
WRT_REG(bx, SEG_ ## hl_handler) \
movw %bx, %es; \
WRT_REG(bx, OFF_ ## hl_handler) \
jmp irq_common;
#endif
#ifndef CONFIG_80286_SUPPORT
#define BIOS_HANDLER_STUB(name, hl_handler) \
_C_LABEL(name): .globl _C_LABEL(name); \
pushl %eax; \
OFF_WRT_CS(eax, far_data_ ## hl_handler) \
jmp sys_common;
#else
#define BIOS_HANDLER_STUB(name, hl_handler) \
_C_LABEL(name): .globl _C_LABEL(name); \
pushw %es; \
pushw %bx; \
WRT_REG(bx, SEG_ ## hl_handler) \
movw %bx, %es; \
WRT_REG(bx, OFF_ ## hl_handler) \
jmp sys_common;
#endif
/* ==================== RUNTIME_RM ==================== */
#ifdef RUNTIME_RM
.section .text.reset, "ax"
.code16
/* .org 0xfff0 */
#ifndef CONFIG_80286_SUPPORT
ex_ljmp reboot
#else
ex_ljmp init_rm_bsp
#endif
/* .org 0xfff5 */
/* ASCII Date ROM was built - 8 characters in MM/DD/YY */
.ascii "12/29/97"
.byte 0
/* .org 0xfffe */
.byte 0xfc /* SYS_MODEL_ID = AT */
.byte 0
.section .rodata
idt_descr: .globl idt_descr
.word 256*8 /* 256 entries */
.long 0
.word 0 /* padding */
.section .text, "ax"
FAR_DATA_DEC(bios_08)
FAR_DATA_DEC(bios_09)
FAR_DATA_DEC(bios_0b)
FAR_DATA_DEC(bios_0c)
FAR_DATA_DEC(bios_0d)
FAR_DATA_DEC(bios_0e)
FAR_DATA_DEC(bios_0f)
FAR_DATA_DEC(bios_11_xxxx)
FAR_DATA_DEC(bios_12_xxxx)
FAR_DATA_DEC(bios_13_xxxx)
FAR_DATA_DEC(bios_14_xxxx)
FAR_DATA_DEC(bios_15_xxxx)
FAR_DATA_DEC(bios_16_xxxx)
FAR_DATA_DEC(bios_17_xxxx)
FAR_DATA_DEC(bios_18_xxxx)
FAR_DATA_DEC(bios_19_xxxx)
#ifdef CONFIG_PCI_SUPPORT
FAR_DATA_DEC(bios_1a_b1xx)
#endif
FAR_DATA_DEC(bios_70)
FAR_DATA_DEC(bios_71)
FAR_DATA_DEC(bios_72)
FAR_DATA_DEC(bios_73)
FAR_DATA_DEC(bios_74)
FAR_DATA_DEC(bios_75)
FAR_DATA_DEC(bios_76)
FAR_DATA_DEC(bios_77)
#ifdef CONFIG_ACPI_SUPPORT
FAR_DATA_DEC(bios_ff)
#endif
FAR_DATA_DEC(bios_dummy)
FAR_DATA_DEC(bios_exception)
.code16gcc
/*
* Exceptions
*/
BIOS_HANDLER_STUB(irq00, bios_exception) /* divide by zero */
BIOS_HANDLER_STUB(irq01, bios_exception) /* debug exception */
BIOS_HANDLER_STUB(irq02, bios_exception) /* nmi interrupt */
BIOS_HANDLER_STUB(irq03, bios_exception) /* breakpoint exception */
BIOS_HANDLER_STUB(irq04, bios_exception) /* overflow exception */
BIOS_HANDLER_STUB(irq05, bios_exception) /* bound range exceeded exception */
BIOS_HANDLER_STUB(irq06, bios_exception) /* invalid opcode */
BIOS_HANDLER_STUB(irq07, bios_exception) /* device not available exception */
/*
* Interrupts 0x00 - 0x07
*/
IRQ_HANDLER_STUB(irq08, bios_08) /* timer */
IRQ_HANDLER_STUB(irq09, bios_09) /* keyboard */
/* irq0a: Not used - cascade */
IRQ_HANDLER_STUB(irq0b, bios_0b) /* rtc */
IRQ_HANDLER_STUB(irq0c, bios_0c) /* ??? */
IRQ_HANDLER_STUB(irq0d, bios_0d) /* ??? */
IRQ_HANDLER_STUB(irq0e, bios_0e) /* floppy */
IRQ_HANDLER_STUB(irq0f, bios_0f) /* parallel port */
/*
* BIOS calls
*/
BIOS_HANDLER_STUB(irq11, bios_11_xxxx)
BIOS_HANDLER_STUB(irq12, bios_12_xxxx)
BIOS_HANDLER_STUB(irq13, bios_13_xxxx)
BIOS_HANDLER_STUB(irq14, bios_14_xxxx)
BIOS_HANDLER_STUB(irq15, bios_15_xxxx)
BIOS_HANDLER_STUB(irq16, bios_16_xxxx)
BIOS_HANDLER_STUB(irq17, bios_17_xxxx)
BIOS_HANDLER_STUB(irq18, bios_18_xxxx)
BIOS_HANDLER_STUB(irq19, bios_19_xxxx)
irq1a: .globl irq1a
ex_ljmp bios_1a
#ifdef CONFIG_PCI_SUPPORT
BIOS_HANDLER_STUB(irq1a_b1xx, bios_1a_b1xx)
#endif
_C_LABEL(irq1c): .globl _C_LABEL(irq1c)
/*
* Shortcut.
* **Don't** call any C function. Will result in stack overflow!
*/
iretw
/*
* Interrupts 0x08 - 0x0f
*/
IRQ_HANDLER_STUB(irq70, bios_70) /* ??? */
IRQ_HANDLER_STUB(irq71, bios_71) /* ??? */
IRQ_HANDLER_STUB(irq72, bios_72) /* ??? */
IRQ_HANDLER_STUB(irq73, bios_73) /* ??? */
IRQ_HANDLER_STUB(irq74, bios_74) /* mouse */
IRQ_HANDLER_STUB(irq75, bios_75) /* ??? */
IRQ_HANDLER_STUB(irq76, bios_76) /* ??? */
IRQ_HANDLER_STUB(irq77, bios_77) /* ??? */
#ifdef CONFIG_ACPI_SUPPORT
/*
* APIC interrupts
*/
IRQ_HANDLER_STUB(irqff, bios_ff) /* spurious apic irq */
#endif
/*
* Dummy handler
*/
BIOS_HANDLER_STUB(irqdummy, bios_dummy)
sys_common:
CALL()
#ifndef CONFIG_80286_SUPPORT
popl %eax
#else
popw %bx
popw %es
#endif
iretw
irq_common:
IRQCALL()
#ifndef CONFIG_80286_SUPPORT
popl %eax
#else
popw %bx
popw %es
#endif
iretw
.section .text.apm
.code32
#ifdef CONFIG_APM_SUPPORT
_C_LABEL(bios_15_53xx_entry): .globl _C_LABEL(bios_15_53xx_entry)
pushfw /* flags */
pushw $0 /* cs */
pushw $0 /* eip */
pushl %eax
call 1f
1: popl %eax
addl $_C_LABEL(bios_15_53xx_pm)-1b, %eax
CALLPM()
popl %eax
addw $2, %sp
addw $2, %sp
popfw
lret
#endif
#ifdef CONFIG_PNP_SUPPORT
/*
* For information see
* "Plug and Play BIOS Specification -- Version 1.0a"
*/
#ifdef RUNTIME_RM
.text
.code16
.globl pnp_real_mode_entry
pnp_real_mode_entry:
pushfl
pushl %esp
jmp stack16;
.text
.code16
.globl pnp_protected_mode_entry
pnp_protected_mode_entry:
pushfl
pushl %esp
/* Fix Stack if it is 16bit. */
pushl %eax
mov %ss, %ax
lar %eax, %eax
test $0x00400000, %eax /* Test Stack "Big" Flag */
popl %eax
jne stack32
stack16:
andl $0x0000ffff, %esp /* We will use code like 4(%esp). */
stack32:
.code16gcc
/*
* Save Registers
*/
pushw %ds
pushw %es
pushl %eax
pushl %ecx
pushl %edx
/* Other registers will be saved by gcc automatically. */
/* Use %ss segment for %ds/%es, too. Needed for gcc code. */
mov %ss, %dx
mov %dx, %ds
mov %dx, %es
/*
* Call Handler
*
* Offset to Parameter Block:
* Far call: 2+2 byte
* pushfl: 4
* pushl %esp: 4
* pushw %ds: 2
* pushw %es: 2
* pushl %eax: 4
* pushl %ecx: 4
* pushl %edx: 4
*/
leal 28(%esp), %edx
movw (%edx), %ax
#ifdef CONFIG_DMI_SUPPORT
1: cmpw $0x50, %ax
jl 1f
cmpw $0x5f, %ax
jg 1f
pushl %edx
ex_lcall dmi_entry
addl $4, %esp
jmp done
#endif /* CONFIG_DMI_SUPPORT */
1:
movw $0x0081, %ax /* Function Not Supported */
done:
/* Restore Registers */
/* Other registers are restored by gcc automatically. */
popl %edx
popl %ecx
movw %ax, (%esp) /* Put return value into low word of %eax. */
popl %eax
popw %es
popw %ds
popl %esp
popfl
lretw
/*
* Orignal Entry
*
* 0336460 24 50 6e 50 10 21 00 00 3e 00 00 0f 00 80 bd 00
* 0336500 f0 58 bd 00 00 0f 00 00 00 00 00 00 f0 00 00 0f
* 0336520 00
*/
.section .rodata.table.pnp
.align 16
.globl pnp
pnp:
.byte '$', 'P', 'n', 'P' /* Signature */
.byte (1 << 4) | (0 << 0) /* Version 1.0 */
.byte pnp_end - pnp
.word 0 /* Control: 0 no change flag supported, yet */
.byte 0 /* Checksum - fixed by external tool. */
.word 0 /* Offset Change Flag */
.word 0 /* Segment Change Flag */
.word OFF_pnp_real_mode_entry /* Offset Real-Mode Code */
.word SEG_pnp_real_mode_entry /* Segment Real-Mode Code */
.word 0x8000 /* Offset Protected Mode Code */
.long pnp_protected_mode_entry - 0x8000 /* Base Protected Mode Code */
.long 0 /* OEM Device Identifier */
.word SEG_pnp_real_mode_entry /* Segment Real-Mode Data */
.long 0 /* Base Protected Mode Data - FIXME */
pnp_end:
#endif /* RUNTIME_RM */
#endif /* CONFIG_PNP_SUPPORT */
.section .text.pci
.code32
#ifdef CONFIG_PCI_SUPPORT
_C_LABEL(bios_pci_pm_entry): .globl _C_LABEL(bios_pci_pm_entry)
pushfw /* flags */
pushw $0 /* cs */
pushw $0 /* eip */
pushl %eax
call 1f
1: popl %eax
addl $_C_LABEL(bios_pci_pm)-1b, %eax
CALLPM()
popl %eax
addw $2, %sp
addw $2, %sp
popfw
lret
#endif
/* FIXME JOSEF: this *must not* be in 0xe000 - 0xffff, but can be anywhere ->
* move it to other ROM part
*/
.section .text.bios32
_C_LABEL(bios32_pm_entry): .globl _C_LABEL(bios32_pm_entry)
pushfw /* flags */
pushw $0 /* cs */
pushw $0 /* eip */
pushl %eax
call 1f
1: popl %eax
addl $_C_LABEL(bios32_pm)-1b, %eax
CALLPM()
popl %eax
addw $2, %sp
addw $2, %sp
popfw
lret
.section .text.org_ff065 /* Default int $10 handler */
/* FIXME */
iret
#endif /* RUNTIME_RM */
#ifdef INIT_RM
.section .text
.code16gcc
_C_LABEL(call_ext): .globl _C_LABEL(call_ext)
#ifndef CONFIG_80286_SUPPORT
popl %edx /* return address */
popl %eax /* parameter */
pusha
#else
popw %dx /* return address - ip */
popw %bx /* return address - cs */
popw %ax /* parameter */
pushaw
#endif
pushw %cs
callw 1f
1:
popw %cx
addw $2f-1b, %cx
pushw %cx
pushw %ax
pushw $3
lretw
2:
#ifndef CONFIG_80286_SUPPORT
popa
pushl %eax /* parameter */
pushl %edx /* return address */
#else
popaw
pushw %ax /* parameter */
pushw %bx /* return address - cs */
pushw %dx /* return address - ip */
#endif
lretw
#endif /* INIT_RM */
#ifdef INIT_RM
.code16
.section .text.head
#ifndef CONFIG_80286_SUPPORT
init_rm_bsp: .globl init_rm_bsp
movw $0, %ax
movw %ax, %ds
movw %ax, %es
movw %ax, %fs
movw %ax, %gs
movw %ax, %ss
movl $evma_stack_bsp-4, %esp
pushl $1
ex_lcall init_rm
addl $4, %esp
ex_ljmp init_boot
#else
init_rm_bsp: .globl init_rm_bsp
/* FIXME ss:sp */
mov $0x1000, %ax
mov %ax, %ss
mov $0x1000, %sp
push $1
ex_lcall init_rm
add $2, %sp
ex_ljmp init_boot
#endif
#ifdef CONFIG_SMP_SUPPORT
init_rm_ap: .globl init_rm_ap
mov $0, %ax
mov %ax, %sp
movl $evma_stack_ap-4, %esp
pushl $0
ex_lcall init_rm
addl $4, %esp
ex_ljmp init_halt
#endif /* CONFIG_SMP_SUPPORT */
#endif /* INIT_RM */
#ifdef RUNTIME_RM
/*
* CAUTION:
* This must be part of RUNTIME_RM.
* AP processors wait here during boot of OS.
*/
.code16
.section .text
init_halt: .globl init_halt
cli
1: hlt
jmp 1b
#endif /* RUNTIME_RM */
#ifdef RUNTIME_RM
/*
* CAUTION:
*
* This *must* be part of RUNTIME_RM.
* It should be able to wipe INIT part of out of memory.
*/
.code16
.section .text
init_boot: .globl init_boot
ex_lcall boot
movzbl %al, %edx /* Bootdev */
/*
* Wipe Memory
* Preserve
* IDT (0x0-0x3ff),
* BDA (0x400-0x4ff),
* bootsector (0x7c00-?),
* BSP stack (?-0x10000), and
* EBDA (0x9f000-0x9ffff).
*/
movw $0, %ax
/* Clear memory in range [0x500-0x7c00). */
movw $0, %bx
movw %bx, %es
movw $0x500, %di
movw $(0x7c00-0x500)/2, %cx
rep stosw %es:(%di)
/* Clear memory in range [0x10000-0x9f000). */
movw $0x1000, %bx
1: movw %bx, %es
movw $0, %di
movw $16/2, %cx
rep stosw %es:(%di)
addw $1, %bx
cmpw $0x9f00, %bx
jb 1b
/* ... - FIXME */
/*
* Setup Registers and Start Bootsector
*/
/* Init segment registers. */
movw $0, %ax
movw %ax, %ss
movw %ax, %ds
movw %ax, %es
movw %ax, %fs
movw %ax, %gs
/* Init general purpose registers. */
movl $0, %ebp
movl $0, %edi
movl $0, %esi
/* %edx: Bootdev: see above. */
movl $0, %ecx
movl $0, %ebx
movl $0, %eax
pushw $0x0002 /* Disabled Interrupts */
pushw $0x0000 /* %cs */
pushw $0x7c00 /* %ip */
iretw
#endif /* RUNTIME_RM */
|