1 # $NetBSD: README.ipl,v 1.1.2.3 2004/09/21 13:15:40 skrll Exp $
5 In order to make this relocatable, you must follow following
8 1. Do not place any objects in text segment
10 (1) do not declare or define any objects to be placed in
11 text segment, that is, do not use ``const'' keyword
12 (but declaring a pointer to const is probably OK),
14 (2) make sure string literals, if any, are placed in data
15 segment (use traditional compiler),
17 (3) avoid initialization of automatic objects (non-static
18 function-local variables) of aggregate types (arrays,
19 structs and unions), which may implicitly emits
22 In summary, do not use ANSI extension. Use traditional C. :-)
24 1.2. For linker, do not actually place objects in text segment.
26 2. Do not use function pointers.
31 We have 6.5KB for the primary boot.
35 000000 0000FC LIF header
37 000200 000194 disklabel (404 bytes for 16-partition label)
39 000400 000400 ipl part 2 (1KB)
40 000800 000100 optional LIF directory
42 000A00 000600 ipl part 3 (1.5KB)
43 001000 001000 ipl part 1 (4KB)
44 002000 (file system starts here)
47 On-memory layout on IPL startup:
49 The firmware loads ipl part 1 on the memory, and executes it.
53 000000 001000 ipl part 1
54 001000 000A00 (not loaded yet)
56 x 001000 temporary disk buffer
60 Then the IPL will load the rest of itself:
62 ipl part 1 loads parts 2 and 3, then continues execution.
66 000000 001000 ipl part 1
67 001000 000400 ipl part 2
68 001400 000600 ipl part 3
69 001A00 xxxxxx (bss section etc)