can anyone explain following jloc script.
{
ALL:
kernel.o
START: 0,0FF800000
,,code,,kernel.o
CODE: 0
,,code
DATA: 0,#10
,,data
BSS: 0,#10
,,bss
}
jloc script
-
Xenos
RE:jloc script
The line 'ALL:' introduces a namespace named ALL. The next line puts the file 'kernel.o' into that namespace.
The other lines describe sections. The first of them is named START. It is expected to appear in a zero-based segment at start address 0xFF800000. This section will contain the contents of the segment named code from kernel.o. It will be located at the beginning of the binary output file.
The next segment is named CODE. It is also zero-based. It will start immediately after START and contain the segments named code from all other input files (here there are none, so this will be empty).
The next segment, named DATA, is also zero-based and starts after CODE, aligned on a 16-byte boundary (#10). It contains the segments named data from all input files. It will appear 16-byte-aligned after CODE in the output file.
The last segment named BSS comes after DATA and is also zero-based and 16-byte-aligned. It contains everything in the segment bss from all input files. Since bss is normally empty, i.e. does not contain initialized data, JLoc will not include it in the output file because there are no sections coming after it that would need the space after DATA.
The result is a binary kernel image, located at 0xFF800000, which looks like this:
START-CODE-(16-byte-alignment)-DATA-(16-byte-alignment)-BSS
where BSS is omitted from the output file.
The other lines describe sections. The first of them is named START. It is expected to appear in a zero-based segment at start address 0xFF800000. This section will contain the contents of the segment named code from kernel.o. It will be located at the beginning of the binary output file.
The next segment is named CODE. It is also zero-based. It will start immediately after START and contain the segments named code from all other input files (here there are none, so this will be empty).
The next segment, named DATA, is also zero-based and starts after CODE, aligned on a 16-byte boundary (#10). It contains the segments named data from all input files. It will appear 16-byte-aligned after CODE in the output file.
The last segment named BSS comes after DATA and is also zero-based and 16-byte-aligned. It contains everything in the segment bss from all input files. Since bss is normally empty, i.e. does not contain initialized data, JLoc will not include it in the output file because there are no sections coming after it that would need the space after DATA.
The result is a binary kernel image, located at 0xFF800000, which looks like this:
START-CODE-(16-byte-alignment)-DATA-(16-byte-alignment)-BSS
where BSS is omitted from the output file.