added base src
[xv6-db.git] / data.S
blobc0eb55bcee2bf1a688e43bef9960e6ddec4dc31e
1 // The kernel layout is:
2 //
3 //     text
4 //     rodata
5 //     data
6 //     bss
7 //
8 // Conventionally, Unix linkers provide pseudo-symbols
9 // etext, edata, and end, at the end of the text, data, and bss.
10 // For the kernel mapping, we need the address at the beginning
11 // of the data section, but that's not one of the conventional
12 // symbols, because the convention started before there was a
13 // read-only rodata section between text and data.
15 // To get the address of the data section, we define a symbol
16 // named data and make sure this is the first object passed to
17 // the linker, so that it will be the first symbol in the data section.
19 // Alternative approaches would be to parse our own ELF header
20 // or to write a linker script, but this is simplest.
22 .data
23 .globl data
24 data:
25   .word 1