@@ -27,34 +27,32 @@ char *heap_end = _end; /* Default end of heap = no heap */
27
27
* screws up the old-style command line protocol, adjust by
28
28
* filling in the new-style command line pointer instead.
29
29
*/
30
-
31
30
static void copy_boot_params (void )
32
31
{
33
32
struct old_cmdline {
34
33
u16 cl_magic ;
35
34
u16 cl_offset ;
36
35
};
37
- const struct old_cmdline * const oldcmd =
38
- absolute_pointer (OLD_CL_ADDRESS );
36
+ const struct old_cmdline * const oldcmd = absolute_pointer (OLD_CL_ADDRESS );
39
37
40
38
BUILD_BUG_ON (sizeof (boot_params ) != 4096 );
41
39
memcpy (& boot_params .hdr , & hdr , sizeof (hdr ));
42
40
43
- if (!boot_params .hdr .cmd_line_ptr &&
44
- oldcmd -> cl_magic == OLD_CL_MAGIC ) {
45
- /* Old-style command line protocol. */
41
+ if (!boot_params .hdr .cmd_line_ptr && oldcmd -> cl_magic == OLD_CL_MAGIC ) {
42
+ /* Old-style command line protocol */
46
43
u16 cmdline_seg ;
47
44
48
- /* Figure out if the command line falls in the region
49
- of memory that an old kernel would have copied up
50
- to 0x90000... */
45
+ /*
46
+ * Figure out if the command line falls in the region
47
+ * of memory that an old kernel would have copied up
48
+ * to 0x90000...
49
+ */
51
50
if (oldcmd -> cl_offset < boot_params .hdr .setup_move_size )
52
51
cmdline_seg = ds ();
53
52
else
54
53
cmdline_seg = 0x9000 ;
55
54
56
- boot_params .hdr .cmd_line_ptr =
57
- (cmdline_seg << 4 ) + oldcmd -> cl_offset ;
55
+ boot_params .hdr .cmd_line_ptr = (cmdline_seg << 4 ) + oldcmd -> cl_offset ;
58
56
}
59
57
}
60
58
@@ -66,6 +64,7 @@ static void copy_boot_params(void)
66
64
static void keyboard_init (void )
67
65
{
68
66
struct biosregs ireg , oreg ;
67
+
69
68
initregs (& ireg );
70
69
71
70
ireg .ah = 0x02 ; /* Get keyboard status */
@@ -83,8 +82,10 @@ static void query_ist(void)
83
82
{
84
83
struct biosregs ireg , oreg ;
85
84
86
- /* Some older BIOSes apparently crash on this call, so filter
87
- it from machines too old to have SpeedStep at all. */
85
+ /*
86
+ * Some older BIOSes apparently crash on this call, so filter
87
+ * it from machines too old to have SpeedStep at all.
88
+ */
88
89
if (cpu .level < 6 )
89
90
return ;
90
91
@@ -119,17 +120,13 @@ static void init_heap(void)
119
120
char * stack_end ;
120
121
121
122
if (boot_params .hdr .loadflags & CAN_USE_HEAP ) {
122
- asm("leal %n1(%%esp),%0"
123
- : "=r" (stack_end ) : "i" (STACK_SIZE ));
124
-
125
- heap_end = (char * )
126
- ((size_t )boot_params .hdr .heap_end_ptr + 0x200 );
123
+ stack_end = (char * ) (current_stack_pointer - STACK_SIZE );
124
+ heap_end = (char * ) ((size_t )boot_params .hdr .heap_end_ptr + 0x200 );
127
125
if (heap_end > stack_end )
128
126
heap_end = stack_end ;
129
127
} else {
130
128
/* Boot protocol 2.00 only, no heap available */
131
- puts ("WARNING: Ancient bootloader, some functionality "
132
- "may be limited!\n" );
129
+ puts ("WARNING: Ancient bootloader, some functionality may be limited!\n" );
133
130
}
134
131
}
135
132
@@ -150,12 +147,11 @@ void main(void)
150
147
151
148
/* Make sure we have all the proper CPU support */
152
149
if (validate_cpu ()) {
153
- puts ("Unable to boot - please use a kernel appropriate "
154
- "for your CPU.\n" );
150
+ puts ("Unable to boot - please use a kernel appropriate for your CPU.\n" );
155
151
die ();
156
152
}
157
153
158
- /* Tell the BIOS what CPU mode we intend to run in. */
154
+ /* Tell the BIOS what CPU mode we intend to run in */
159
155
set_bios_mode ();
160
156
161
157
/* Detect memory layout */
0 commit comments