Move files out of root into core, dos, and utils
[syslinux.git] / core / layout.inc
blob51460e143289dba3c57e2cb9e225e310fc4d66a2
1 ; -----------------------------------------------------------------------
3 ;   Copyright 1994-2008 H. Peter Anvin - All Rights Reserved
5 ;   This program is free software; you can redistribute it and/or modify
6 ;   it under the terms of the GNU General Public License as published by
7 ;   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 ;   Bostom MA 02111-1307, USA; either version 2 of the License, or
9 ;   (at your option) any later version; incorporated herein by reference.
11 ; -----------------------------------------------------------------------
14 ; layout.inc
16 ; Memory layout of segments
19                 ; Default to 16-bit code
20                 bits 16
22 ; Memory below 0800h is reserved for the BIOS and the MBR.
23 BSS_START       equ 0800h
25 ; Text starts at the load address of 07C00h.
26 TEXT_START      equ 7C00h
28 ; The secondary BSS section, above the text; we really wish we could
29 ; just make it follow .bcopy32 or hang off the end,
30 ; but it doesn't seem to work that way.
31 LATEBSS_START   equ 0B800h
33 %ifdef MAP
34                 [map all MAP]
35 %endif
38 ; The various sections and their relationship
40                 ; Use .earlybss for things that MUST be in low memory.
41                 section .earlybss       nobits start=BSS_START
42                 section .bcopy32        exec nowrite progbits align=4
43                 section .config         write progbits align=4
44                 section .config.end     write nobits   align=4
46                 ; Use .bss for things that doesn't have to be in low memory;
47                 ; with .bss1 and .bss2 to offload.  .earlybss should be used
48                 ; for things that absolutely have to be below 0x7c00.
49                 section .bss            write nobits align=16
51                 ; Warning here: RBFG build 22 randomly overwrites
52                 ; memory location [0x5680,0x576c), possibly more.  It
53                 ; seems that it gets confused and screws up the
54                 ; pointer to its own internal packet buffer and starts
55                 ; writing a received ARP packet into low memory.
56 %if IS_PXELINUX
57                 section .rbfg           write nobits
58 RBFG_brainfuck: resb 2048               ; Bigger than an Ethernet packet...
59 %endif
61                 ; For section following .rbfg
62 %if IS_PXELINUX
63                 section .bss2           write nobits align=16
64 %else
65                 section .bss2           write nobits align=16
66 %endif
68                 section .text           exec write progbits align=16
69                 section .data           write progbits align=16
71                 section .adv            write nobits align=512
73                 ; .uibss contains bss data which is guaranteed to be
74                 ; safe to clobber during the loading of the image.  This
75                 ; is because while loading the primary image we will clobber
76                 ; the spillover from the last fractional sector load.
77                 section .uibss          write nobits align=16
79                 ; Normal bss...
80                 section .bss1           write nobits align=16
82                 ; Symbols from linker script
83 %macro SECINFO 1
84                 extern __%1_start, __%1_lma, __%1_end
85                 extern __%1_len, __%1_dwords
86 %endmacro
87                 SECINFO bcopy32
88                 SECINFO config
90                 global _start
92                 section .text