ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

linux.h
Go to the documentation of this file.
00001 /*
00002  *  FreeLoader
00003  *  Copyright (C) 1998-2003  Brian Palmer  <brianp@sginet.com>
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License along
00016  *  with this program; if not, write to the Free Software Foundation, Inc.,
00017  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00018  */
00019 
00020 #include <fs.h>
00021 
00022 #ifndef __LINUX_H
00023 #define __LINUX_H
00024 
00025 #ifdef __i386__
00026 #define LINUX_LOADER_TYPE_LILO          0x01
00027 #define LINUX_LOADER_TYPE_LOADLIN       0x11
00028 #define LINUX_LOADER_TYPE_BOOTSECT      0x21
00029 #define LINUX_LOADER_TYPE_SYSLINUX      0x31
00030 #define LINUX_LOADER_TYPE_ETHERBOOT     0x41
00031 #define LINUX_LOADER_TYPE_FREELOADER    0x81
00032 
00033 #define LINUX_COMMAND_LINE_MAGIC        0xA33F
00034 
00035 #define LINUX_SETUP_HEADER_ID           0x53726448          // 'HdrS'
00036 
00037 #define LINUX_BOOT_SECTOR_MAGIC         0xAA55
00038 
00039 #define LINUX_KERNEL_LOAD_ADDRESS       0x100000
00040 
00041 #define LINUX_FLAG_LOAD_HIGH            0x01
00042 #define LINUX_FLAG_CAN_USE_HEAP         0x80
00043 
00044 #define LINUX_MAX_INITRD_ADDRESS        0x38000000
00045 
00046 #include <pshpack1.h>
00047 typedef struct
00048 {
00049     UCHAR       BootCode1[0x20];
00050 
00051     USHORT      CommandLineMagic;
00052     USHORT      CommandLineOffset;
00053 
00054     UCHAR       BootCode2[0x1CD];
00055 
00056     UCHAR       SetupSectors;
00057     USHORT      RootFlags;
00058     USHORT      SystemSize;
00059     USHORT      SwapDevice;
00060     USHORT      RamSize;
00061     USHORT      VideoMode;
00062     USHORT      RootDevice;
00063     USHORT      BootFlag;           // 0xAA55
00064 
00065 } LINUX_BOOTSECTOR, *PLINUX_BOOTSECTOR;
00066 
00067 typedef struct
00068 {
00069     UCHAR       JumpInstruction[2];
00070     ULONG       SetupHeaderSignature;   // Signature for SETUP-header
00071     USHORT      Version;                // Version number of header format
00072     USHORT      RealModeSwitch;         // Default switch
00073     USHORT      SetupSeg;               // SETUPSEG
00074     USHORT      StartSystemSeg;
00075     USHORT      KernelVersion;          // Offset to kernel version string
00076     UCHAR       TypeOfLoader;           // Loader ID
00077                                     // =0, old one (LILO, Loadlin,
00078                                     //     Bootlin, SYSLX, bootsect...)
00079                                     // else it is set by the loader:
00080                                     // 0xTV: T=0 for LILO
00081                                     //       T=1 for Loadlin
00082                                     //       T=2 for bootsect-loader
00083                                     //       T=3 for SYSLX
00084                                     //       T=4 for ETHERBOOT
00085                                     //       V = version
00086 
00087     UCHAR       LoadFlags;              // flags, unused bits must be zero (RFU)
00088                                     // LOADED_HIGH = 1
00089                                     // bit within loadflags,
00090                                     // if set, then the kernel is loaded high
00091                                     // CAN_USE_HEAP = 0x80
00092                                     // if set, the loader also has set heap_end_ptr
00093                                     // to tell how much space behind setup.S
00094                                     // can be used for heap purposes.
00095                                     // Only the loader knows what is free!
00096 
00097     USHORT      SetupMoveSize;          // size to move, when we (setup) are not
00098                                     // loaded at 0x90000. We will move ourselves
00099                                     // to 0x90000 then just before jumping into
00100                                     // the kernel. However, only the loader
00101                                     // know how much of data behind us also needs
00102                                     // to be loaded.
00103 
00104     ULONG       Code32Start;            // here loaders can put a different
00105                                     // start address for 32-bit code.
00106                                     //
00107                                     //   0x1000 = default for zImage
00108                                     //
00109                                     // 0x100000 = default for big kernel
00110 
00111     ULONG       RamdiskAddress;         // address of loaded ramdisk image
00112                                     // Here the loader (or kernel generator) puts
00113                                     // the 32-bit address were it loaded the image.
00114     ULONG       RamdiskSize;            // its size in bytes
00115 
00116     USHORT      BootSectKludgeOffset;
00117     USHORT      BootSectKludgeSegment;
00118     USHORT      HeapEnd;                // space from here (exclusive) down to
00119                                     // end of setup code can be used by setup
00120                                     // for local heap purposes.
00121     USHORT      Pad1;
00122     ULONG       CommandLinePointer;     // 32-bit pointer to the kernel command line
00123     ULONG       InitrdAddressMax;       // Highest legal initrd address
00124 
00125 
00126 } LINUX_SETUPSECTOR, *PLINUX_SETUPSECTOR;
00127 #include <poppack.h>
00128 
00129 VOID    BootNewLinuxKernel(VOID);               // Implemented in linux.S
00130 VOID    BootOldLinuxKernel(ULONG KernelSize);       // Implemented in linux.S
00131 
00132 VOID    LoadAndBootLinux(PCSTR OperatingSystemName, PCSTR Description);
00133 
00134 BOOLEAN LinuxParseIniSection(PCSTR OperatingSystemName);
00135 BOOLEAN LinuxReadBootSector(PFILE LinuxKernelFile);
00136 BOOLEAN LinuxReadSetupSector(PFILE LinuxKernelFile);
00137 BOOLEAN LinuxReadKernel(PFILE LinuxKernelFile);
00138 BOOLEAN LinuxCheckKernelVersion(VOID);
00139 BOOLEAN LinuxReadInitrd(PFILE LinuxInitrdFile);
00140 #endif /* __i386__ */
00141 
00142 #endif // defined __LINUX_H

Generated on Sat May 26 2012 04:17:59 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.