You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The flags added to the first command are there to help GCC produce could that will run in kernel space.
101
+
The second command simply takes kernel.o and orders it as the linker script tells it to.
102
+
103
+
## Contributors note
104
+
105
+
The `_start` symbol must always appear first within flat binaries as Pure64 will call the start of the file so it must contain executable code. Function definitions (such as inline ones) in header files could interfere with the placement of the `_start` symbol. The best solution is to put the entry point in a separate file that calls the main function. Such a file could be called `start.c`.
106
+
```
107
+
extern int main(void);
108
+
109
+
void _start(void)
110
+
{
111
+
main();
112
+
}
113
+
```
114
+
This file would **always** have to be linked in front of everything else. For the above example that would mean the linker command above would have to become:
115
+
```
116
+
ld -T kernel.ld -o kernel.bin start.o kernel.o
71
117
```
72
118
73
-
The flags added to the command are there to help GCC produce could that will run in kernel space.
119
+
## Creating a bootable image
120
+
121
+
After creating a kernel this is a possible routine to create a bootable image.
122
+
The commands require Pure64 to be build and `pure64.sys` and `mbr.sys` to be in the same directory
0 commit comments