vfs: Implement proper O_SYNC semantics
[safe/jmp/linux-2.6] / arch / x86 / boot / header.S
index 4cc5b04..b31cc54 100644 (file)
 #include <linux/utsrelease.h>
 #include <asm/boot.h>
 #include <asm/e820.h>
-#include <asm/page.h>
+#include <asm/page_types.h>
 #include <asm/setup.h>
 #include "boot.h"
+#include "voffset.h"
+#include "zoffset.h"
 
-SETUPSECTS     = 4                     /* default nr of setup-sectors */
 BOOTSEG                = 0x07C0                /* original address of boot-sector */
-SYSSEG         = DEF_SYSSEG            /* system loaded at 0x10000 (65536) */
-SYSSIZE                = DEF_SYSSIZE           /* system size: # of 16-byte clicks */
-                                       /* to be loaded */
-ROOT_DEV       = 0                     /* ROOT_DEV is now written by "build" */
-SWAP_DEV       = 0                     /* SWAP_DEV is now written by "build" */
+SYSSEG         = 0x1000                /* historical load address >> 4 */
 
 #ifndef SVGA_MODE
 #define SVGA_MODE ASK_VGA
@@ -97,12 +94,12 @@ bugger_off_msg:
        .section ".header", "a"
        .globl  hdr
 hdr:
-setup_sects:   .byte SETUPSECTS
+setup_sects:   .byte 0                 /* Filled in by build.c */
 root_flags:    .word ROOT_RDONLY
-syssize:       .long SYSSIZE
-ram_size:      .word RAMDISK
+syssize:       .long 0                 /* Filled in by build.c */
+ram_size:      .word 0                 /* Obsolete */
 vid_mode:      .word SVGA_MODE
-root_dev:      .word ROOT_DEV
+root_dev:      .word 0                 /* Filled in by build.c */
 boot_flag:     .word 0xAA55
 
        # offset 512, entry point
@@ -119,18 +116,19 @@ _start:
        # Part 2 of the header, from the old setup.S
 
                .ascii  "HdrS"          # header signature
-               .word   0x0207          # header version number (>= 0x0105)
+               .word   0x020a          # header version number (>= 0x0105)
                                        # or else old loadlin-1.5 will fail)
                .globl realmode_swtch
 realmode_swtch:        .word   0, 0            # default_switch, SETUPSEG
-start_sys_seg: .word   SYSSEG
+start_sys_seg: .word   SYSSEG          # obsolete and meaningless, but just
+                                       # in case something decided to "use" it
                .word   kernel_version-512 # pointing to kernel version string
                                        # above section of header is compatible
                                        # with loadlin-1.5 (header v1.5). Don't
                                        # change it.
 
-type_of_loader:        .byte   0               # = 0, old one (LILO, Loadlin,
-                                       #      Bootlin, SYSLX, bootsect...)
+type_of_loader:        .byte   0               # 0 means ancient bootloader, newer
+                                       # bootloaders know to change this.
                                        # See Documentation/i386/boot.txt for
                                        # assigned ids
 
@@ -142,11 +140,7 @@ CAN_USE_HEAP       = 0x80                  # If set, the loader also has set
                                        # space behind setup.S can be used for
                                        # heap purposes.
                                        # Only the loader knows what is free
-#ifndef __BIG_KERNEL__
-               .byte   0
-#else
                .byte   LOADED_HIGH
-#endif
 
 setup_move_size: .word  0x8000         # size to move, when setup is not
                                        # loaded at 0x90000. We will move setup
@@ -157,11 +151,7 @@ setup_move_size: .word  0x8000             # size to move, when setup is not
 
 code32_start:                          # here loaders can put a different
                                        # start address for 32-bit code.
-#ifndef __BIG_KERNEL__
-               .long   0x1000          #   0x1000 = default for zImage
-#else
                .long   0x100000        # 0x100000 = default for big kernel
-#endif
 
 ramdisk_image: .long   0               # address of loaded ramdisk image
                                        # Here the loader puts the 32-bit
@@ -179,7 +169,11 @@ heap_end_ptr:      .word   _end+STACK_SIZE-512
                                        # end of setup code can be used by setup
                                        # for local heap purposes.
 
-pad1:          .word   0
+ext_loader_ver:
+               .byte   0               # Extended boot loader version
+ext_loader_type:
+               .byte   0               # Extended boot loader type
+
 cmd_line_ptr:  .long   0               # (Header version 0x0202 or later)
                                        # If nonzero, a 32-bit pointer
                                        # to the kernel command line.
@@ -195,10 +189,13 @@ cmd_line_ptr:     .long   0               # (Header version 0x0202 or later)
                                        # can be located anywhere in
                                        # low memory 0x10000 or higher.
 
-ramdisk_max:   .long (-__PAGE_OFFSET-(512 << 20)-1) & 0x7fffffff
+ramdisk_max:   .long 0x7fffffff
                                        # (Header version 0x0203 or later)
                                        # The highest safe address for
                                        # the contents of an initrd
+                                       # The current kernel allows up to 4 GB,
+                                       # but leave it at 2 GB to avoid
+                                       # possible bootloader bugs.
 
 kernel_alignment:  .long CONFIG_PHYSICAL_ALIGN #physical addr alignment
                                                #required for protected mode
@@ -208,7 +205,7 @@ relocatable_kernel:    .byte 1
 #else
 relocatable_kernel:    .byte 0
 #endif
-pad2:                  .byte 0
+min_alignment:         .byte MIN_KERNEL_ALIGN_LG2      # minimum alignment
 pad3:                  .word 0
 
 cmdline_size:   .long   COMMAND_LINE_SIZE-1     #length of the command line,
@@ -220,9 +217,27 @@ hardware_subarch:  .long 0                 # subarchitecture, added with 2.07
 
 hardware_subarch_data: .quad 0
 
+payload_offset:                .long ZO_input_data
+payload_length:                .long ZO_z_input_len
+
+setup_data:            .quad 0                 # 64-bit physical pointer to
+                                               # single linked list of
+                                               # struct setup_data
+
+pref_address:          .quad LOAD_PHYSICAL_ADDR        # preferred load addr
+
+#define ZO_INIT_SIZE   (ZO__end - ZO_startup_32 + ZO_z_extract_offset)
+#define VO_INIT_SIZE   (VO__end - VO__text)
+#if ZO_INIT_SIZE > VO_INIT_SIZE
+#define INIT_SIZE ZO_INIT_SIZE
+#else
+#define INIT_SIZE VO_INIT_SIZE
+#endif
+init_size:             .long INIT_SIZE         # kernel initialization size
+
 # End of setup header #####################################################
 
-       .section ".inittext", "ax"
+       .section ".entrytext", "ax"
 start_of_setup:
 #ifdef SAFE_RESET_DISK_CONTROLLER
 # Reset the disk controller.