direct-io.hg

view tools/misc/mbootpack/bootsect.S @ 7477:5a7baecb1c70

Fix an issue for passing arguement from control panel to deivce model
for some arguemnt like 'localtime', 'isa', device model need an argument
"-localtime", instead of "-localtime 1"
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Sun Oct 23 16:51:47 2005 +0100 (2005-10-23)
parents 445b12a7221a
children
line source
1 /*
2 * bootsect.S
3 *
4 * This is bootsect.S from the linux 2.6.9 sources,
5 * with minor changes for mbootpack.
6 *
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of the
11 * License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 * 02111-1307, USA.
22 *
23 * $Id: bootsect.S,v 1.2 2005/03/23 10:39:11 tjd21 Exp $
24 *
25 */
27 #include "mbootpack.h"
29 /*
30 * bootsect.S Copyright (C) 1991, 1992 Linus Torvalds
31 *
32 * modified by Drew Eckhardt
33 * modified by Bruce Evans (bde)
34 * modified by Chris Noe (May 1999) (as86 -> gas)
35 * gutted by H. Peter Anvin (Jan 2003)
36 *
37 * BIG FAT NOTE: We're in real mode using 64k segments. Therefore segment
38 * addresses must be multiplied by 16 to obtain their respective linear
39 * addresses. To avoid confusion, linear addresses are written using leading
40 * hex while segment addresses are written as segment:offset.
41 *
42 */
44 /* #include <asm/boot.h> */
45 /* Definitions we should have got from there */
46 #define DEF_INITSEG 0x9000
47 #define DEF_SYSSEG 0x1000
48 #define DEF_SETUPSEG 0x9020
49 #define DEF_SYSSIZE 0x7F00
50 #define NORMAL_VGA 0xffff
51 #define EXTENDED_VGA 0xfffe
52 #define ASK_VGA 0xfffd
55 /* SETUPSECTS = 4 */ /* default nr of setup-sectors */
56 BOOTSEG = 0x07C0 /* original address of boot-sector */
57 INITSEG = DEF_INITSEG /* we move boot here - out of the way */
58 SETUPSEG = DEF_SETUPSEG /* setup starts here */
59 SYSSEG = DEF_SYSSEG /* system loaded at 0x10000 (65536) */
60 SYSSIZE = DEF_SYSSIZE /* system size: # of 16-byte clicks */
61 /* to be loaded */
62 ROOT_DEV = 0 /* ROOT_DEV is now written by "build" */
63 SWAP_DEV = 0 /* SWAP_DEV is now written by "build" */
65 #ifndef SVGA_MODE
66 /* #define SVGA_MODE ASK_VGA */
67 #define SVGA_MODE NORMAL_VGA
68 #endif
70 #ifndef RAMDISK
71 #define RAMDISK 0
72 #endif
74 #ifndef ROOT_RDONLY
75 #define ROOT_RDONLY 1
76 #endif
78 .code16
79 .text
81 .global _start
82 _start:
84 # Normalize the start address
85 jmpl $BOOTSEG, $start2
87 start2:
88 movw %cs, %ax
89 movw %ax, %ds
90 movw %ax, %es
91 movw %ax, %ss
92 movw $0x7c00, %sp
93 sti
94 cld
96 movw $bugger_off_msg, %si
98 msg_loop:
99 lodsb
100 andb %al, %al
101 jz die
102 movb $0xe, %ah
103 movw $7, %bx
104 int $0x10
105 jmp msg_loop
107 die:
108 # Allow the user to press a key, then reboot
109 xorw %ax, %ax
110 int $0x16
111 int $0x19
113 # int 0x19 should never return. In case it does anyway,
114 # invoke the BIOS reset code...
115 ljmp $0xf000,$0xfff0
118 bugger_off_msg:
119 .ascii "Direct booting from floppy is no longer supported.\r\n"
120 .ascii "Please use a boot loader program instead.\r\n"
121 .ascii "\n"
122 .ascii "Remove disk and press any key to reboot . . .\r\n"
123 .byte 0
126 # Kernel attributes; used by setupbegtext
128 .org 497
129 setup_sects: .byte SETUPSECTS
130 root_flags: .word ROOT_RDONLY
131 syssize: .word SYSSIZE
132 swap_dev: .word SWAP_DEV
133 ram_size: .word RAMDISK
134 vid_mode: .word SVGA_MODE
135 root_dev: .word ROOT_DEV
136 boot_flag: .word 0xAA55