@@ -11,8 +11,8 @@ The main build artifact that can be built from the code in this
11
11
repository is the kernel image, which contains the kernel proper as well
12
12
as the user space loader. The kernel image conforms to the
13
13
[ Linux x86 boot protocol] ( https://www.kernel.org/doc/Documentation/x86/boot.rst ) ,
14
- which means it can be loaded by a bootloader intended
15
- for the Linux kernel, such as GRUB.
14
+ which means it can be loaded by a bootloader intended for the Linux
15
+ kernel, such as GRUB.
16
16
17
17
During the boot process, the user space loader expects an initial RAM
18
18
disk to have been loaded in memory by the bootloader. This would usually
@@ -27,19 +27,19 @@ that contains the kernel image and the initial RAM disk.
27
27
Build Requirements
28
28
------------------
29
29
30
- To build the kernel image and test application, you will need a Linux
31
- machine with GNU make and a C compiler that can create 32-bit x86 ELF
32
- binaries. This software is known to build with GCC and clang.
30
+ To build the kernel image and test application, you need a Linux machine
31
+ with GNU make and a C compiler that can create 32-bit x86 ELF binaries.
32
+ This software is known to build with GCC and clang.
33
33
34
- You will also need the Netwide Assembler (NASM).
34
+ You also need the Netwide Assembler (NASM).
35
35
36
36
If you wish to build the ISO image for use with QEMU, which is optional,
37
- you will need GRUB and GNU xorriso in addition to the above.
37
+ you need GRUB and GNU xorriso in addition to the above.
38
38
39
39
Run Time Requirements
40
40
---------------------
41
41
42
- To boot the Jinue microkernel , you will need either:
42
+ To run this software , you need either:
43
43
* QEMU; or
44
44
* A x86 PC on which you have sufficient privileges to configure the boot
45
45
manager to load Jinue.
@@ -54,71 +54,122 @@ the `--recurse-submodules` option when you clone the repository.
54
54
```
55
55
git clone --recurse-submodules https://github.com/phaubertin/jinue.git
56
56
```
57
+
57
58
Alternatively, if you already cloned the repository without passing this
58
- option, you can clone and initialize the submodules separately with the
59
- following command:
59
+ option, you can initialize the submodules separately with the following
60
+ command:
60
61
61
62
```
62
63
git submodule update --init
63
64
```
64
65
65
66
Then, configure the source code and its dependencies. You only need to
66
- do this oncen not each time you build.
67
+ do this once, not each time you build.
68
+
67
69
```
68
70
./configure
69
71
```
70
72
71
73
To build the ISO image for use with QEMU, build the ` qemu ` target with
72
74
make:
75
+
73
76
```
74
77
make qemu
75
78
```
79
+
80
+ This builds the kernel image and the test application, and then creates
81
+ a bootable ISO image.
82
+
76
83
If you will not be using QEMU and only want to build the kernel image,
77
84
this can be done with the default make target:
85
+
78
86
```
79
87
make
80
88
```
81
89
90
+ Similarly, the test application can be built separately with the
91
+ ` testapp ` make target:
92
+
93
+ ```
94
+ make testapp
95
+ ```
96
+
82
97
How to Run in QEMU
83
98
-------------------
84
99
You can run the kernel and test application in QEMU using the ` qemu-run `
85
100
make target:
101
+
86
102
```
87
103
make qemu-run
88
104
```
105
+
89
106
Alternatively, if you don't want QEMU to show a window with the video
90
107
output, or if you are on a machine without graphics capabilities, use
91
108
the ` qemu-run-no-display ` target instead. The kernel logs to the serial
92
109
port, which QEMU redirects to standard output.
110
+
93
111
```
94
112
make qemu-run-no-display
95
113
```
96
114
115
+ In either case, this generates a log file called ` run-jinue.log ` in
116
+ ` devel/qemu/ ` with the full kernel and test application output.
117
+
118
+ Finally, you can run the kernel and test application, and then run a
119
+ script that performs checks on the log file by using the ` qemu-check `
120
+ make target:
121
+
122
+ ```
123
+ make qemu-check
124
+ ```
125
+
97
126
How to Install
98
127
--------------
99
128
100
129
If you will not be using QEMU for testing, you can copy the kernel image
101
130
to ` /boot ` by running the following:
131
+
102
132
```
103
133
sudo make install
104
134
```
105
- The file name and path of the installed kernel image file is
135
+
136
+ The full file path of the kernel image installed in this way is
106
137
` /boot/jinue ` .
107
138
108
139
Optionally, if you will not be providing your own initial RAM disk file,
109
140
you can install the test application initial RAM disk to ` /boot ` as
110
141
well.
142
+
111
143
```
112
144
sudo make install-testapp
113
145
```
114
- The file name and path of the installed RAM disk file is
146
+
147
+ The full file path of the installed RAM disk file is
115
148
` /boot/jinue-testapp-initrd.tar.gz ` .
116
149
117
150
Once this is done, you need to configure your boot loader/manager to
118
- load this kernel. Jinue uses the 16-bit Linux boot protocol, so you can
119
- configure your boot manager as if you were loading a Linux image with
120
- the 16-bit boot protocol
121
- ([ linux16 command] ( devel/virtualbox/grub.cfg#L29 ) if using GRUB).
151
+ load the installed kernel. Jinue uses the (32-bit or 16-bit) Linux x86
152
+ boot protocol, so you can configure your boot manager as if you were
153
+ loading a Linux image. This is system dependent but, with GRUB, the
154
+ configuration entry might look something like this:
155
+
156
+ ```
157
+ menuentry 'Jinue (32-bit boot protocol, test app)' {
158
+ # Replace with the appropriate GRUB module for your filesystem.
159
+ insmod ext2
160
+ # Replace with the partition where you installed Jinue.
161
+ set root='hd0,msdos7'
162
+ set gfxpayload='text'
163
+ echo 'Loading Jinue microkernel...'
164
+ # See command line documentation for details on the command line options.
165
+ linux /boot/jinue vga_enable=yes serial_enable=no DEBUG_DUMP_MEMORY_MAP=1 DEBUG_DUMP_SYSCALL_IMPLEMENTATION=1 DEBUG_DUMP_RAMDISK=1 RUN_TEST_IPC=1
166
+ echo 'Loading test application initial RAM disk...'
167
+ initrd /boot/jinue-testapp-initrd.tar.gz
168
+ }
169
+ ```
170
+
171
+ For detail on the command line options, see the [ command line
172
+ documentation] ( doc/cmdline.md ) .
122
173
123
174
For detail on the Linux boot protocol, see
124
175
[ Documentation/x86/boot.rst] ( https://www.kernel.org/doc/Documentation/x86/boot.rst )
@@ -127,5 +178,6 @@ in the Linux source tree.
127
178
Documentation
128
179
-------------
129
180
130
- There is some documentation in the [ doc/ directory] ( doc/README.md ) . It
131
- is still very much a work in progress.
181
+ There is some documentation in the ` doc/ ` directory] . It is still a work
182
+ in progress and some of it is not up to date. The [ documentation file
183
+ README] ( doc/README.md ) links to the parts that are up to date.
0 commit comments