SimpleOS

LXR

Navigation



Site hébergé par : enix

The LXR Cross Referencer for SOS

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Article:1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 6.5 ] [ 7 ] [ 7.5 ] [ 8 ] [ 9 ] [ 9.5 ]

001 /* Copyright (C) 2004, David Decotigny
002 
003    This program is free software; you can redistribute it and/or
004    modify it under the terms of the GNU General Public License
005    as published by the Free Software Foundation; either version 2
006    of the License, or (at your option) any later version.
007    
008    This program is distributed in the hope that it will be useful,
009    but WITHOUT ANY WARRANTY; without even the implied warranty of
010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
011    GNU General Public License for more details.
012    
013    You should have received a copy of the GNU General Public License
014    along with this program; if not, write to the Free Software
015    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
016    USA. 
017 */
018 
019 SECTIONS
020 {
021     /* ***********************************************
022      * The bootsector is here. We link it against the remaining of the kernel
023      * in order to automatically figure out its size that must be loaded
024      * from file to memory (see the load_size definition below)
025      */
026 
027     /* If we use one, we put the boot sector here. We don't set its
028      * address to 0x7c000 (aka 0x7c00:0), since it reloads itself to
029      * 0x9f000, causing the 0x7c000 address to be meaningless too. So we
030      * chose to pretend that the address is 0x0, and to make a little
031      * address arithmetic in bootsect.S */
032     .bootsect 0x0 :
033     {
034       /* The code for the boot sector goes here */
035       *(.bootsect);
036 
037       /* The load_size symbol contains the size of the area (in
038        * sectors, aka 512 Bytes) that the boot sector should copy from
039        * the disk. The bss section is not included since it uses 0
040        * bytes on disk. This variable is short (16b) because it is used
041        * by the bootsector in real mode, and this is enough because
042        * our boot sector cannot transfer more than 1264 sectors (see
043        * bootsector sources) */
044       load_size = .;
045       SHORT((__e_load - __b_load + 511) >> 9);
046       /* ---> This is equivalent to ceil( (__e_load - __b_load) / 512 ) */
047 
048       /* At offsets 511 and 512, we set the boot sector signature (AA55h) */
049       . = 0x1fe;
050       SHORT(0xAA55);
051     }
052 }
053 
054 
055 /* This is to avoid a cut/paste here. Please notice that a multiboot
056  * section WILL be inserted, which is NOT mandatory (we could have
057  * removed it without getting into trouble). Please note however that
058  * the *.bin files will NOT be multiboot compatible (they are not in ELF
059  * format): they are expected to be directly booted by the BIOS (or
060  * by the "chainloader" command of Grub). */
061 INCLUDE ../support/sos.lds
062 
063 /* We overload the entry set in sos.lds, just to avoid an ld warning */
064 ENTRY(sos_main);

source navigation ] diff markup ] identifier search ] general search ]