VirtualBox

source: vbox/trunk/src/VBox/Devices/PC/Etherboot-src/arch/i386/prefix/comprefix.S@ 16444

Last change on this file since 16444 was 1, checked in by vboxsync, 55 years ago

import

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.3 KB
Line 
1/* We need a real mode stack that won't be stomped on by Etherboot
2 which starts at 0x20000. Choose something that's sufficiently high,
3 but not in DOC territory. Note that we couldn't do this in a real
4 .com program since stack variables are in the same segment as the
5 code and data, but this isn't really a .com program, it just looks
6 like one to make DOS load it into memory. It still has the 64kB
7 limitation of .com files though. */
8#define STACK_SEG 0x7000
9#define STACK_SIZE 0x4000
10
11 .text
12 .code16
13 .arch i386
14 .section ".prefix", "ax", @progbits
15 .globl _prefix
16
17/* Cheat a little with the relocations: .COM files are loaded at 0x100 */
18_prefix:
19 /* Set up temporary stack */
20 movw $STACK_SEG, %ax
21 movw %ax, %ss
22 movw $STACK_SIZE, %sp
23
24 pushl $0 /* No parameters to preserve for exit path */
25 pushw $0 /* Dummy return address - use prefix_exit */
26
27 /* Calculate segment address of image start */
28 pushw %cs
29 popw %ax
30 addw $(0x100/16), %ax
31 pushw %ax
32 pushw $_start
33 /* Calculated lcall to _start with %cs:0000 = image start */
34 lret
35
36 .section ".text16", "ax", @progbits
37 .globl prefix_exit
38prefix_exit:
39 movw $0x4c00,%ax /* return to DOS */
40 int $0x21 /* reach this on Quit */
41 .globl prefix_exit_end
42prefix_exit_end:
43 .previous
44
45/* The body of etherboot is attached here at build time.
46 * Force 16 byte alignment
47 */
48 .align 16,0
49_body:
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette