-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathBINDING
72 lines (52 loc) · 2.5 KB
/
BINDING
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Binding To Atlas.o
Requirements:
1. The file to be linked to Atlas must have a function called
start(). At linking Atlas will look for the start identifier
to call at boot.
2. The object file to link to must be compiled with the
relocatable flag. This will allow it to at a later time have
atlas fill in the blanks of functions like the base text
video library.
3. The object file to link must be set explicitly for thirty
bit compilation. Atlas is currently a thirty two bit system,
and only thirty two bit code will link and boot.
ex.
gcc -m32 -c $(file).c -o $(file).o
or
gcc -m32 -c -I /path/to/include/ $(file).c -o $(file).o
Standard Bind:
Assuming a file has been made with the preceding requirements, you
can simply bind to an object file using make target. The makefile for
Atlas allows you to target a specific file for binding, and makes the
linking process very easy.
To link Atlas with target binding:
make target TARGET=$(OBJFILE)
Output:
Atlas will produce a file called Atlas.img that is the direct
image output of the file you targeted with Atlas bound to it.
This file can be renamed or moved with no issue, it is a fully
portable file that is ready to be burned to a disk.
I prefer to use qemu-system-32 to test the images, it boots fast
and has been proven to reliably boot Atlas.
No Target Binding:
No target binding implies that you have made (make) the Atlas.o
object with or without the base libraries. After the object file
has been made, it can be linked (bound) to a relocatable file
that will be the kernel.
Process:
After the kernel or program has been succesfully been compiled
, the file can be linked to Atlas using a linker script. A
premade script can be found in the scripts folder, it must be
used for Atlas to successfully boot a kernel or program.
The output format is described in the linker script, and the
final output must be in the binary format, allowing direct
translation from the processor.
Example Link:
ld -T /path/to/script/script.ld Atlas.o $(OBJFILE) -o $(OUTPUT)
*WARNING
WARNING:
Atlas as of the current version is only capable of loading 127 sector from the disk. This is a STATIC value, meaning that if there is not 127
sectors on the hard disk, Atlas will fault and fail. To compensate for
this, Atlas target build cat's 10 megabytes of data just to be safe. If
the program being booted by atlas is not 127 sectors in size, the system
WILL FAIL.