2020-11-28 16:24:50 -05:00
|
|
|
#include <kernaux/multiboot2.h>
|
|
|
|
|
2020-11-29 07:57:34 -05:00
|
|
|
#include <assert.h>
|
2020-11-28 16:24:50 -05:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
static const unsigned char multiboot2_example[864] = {
|
|
|
|
96, 3, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 12, 0, 0, 0,
|
|
|
|
0, 0, 64, 0, 0, 0, 232, 133, 1, 0, 0, 0, 21, 0, 0, 0,
|
|
|
|
104, 101, 108, 108, 111, 32, 107, 101, 114, 110, 101, 108, 0, 139, 69, 228,
|
|
|
|
2, 0, 0, 0, 30, 0, 0, 0, 71, 82, 85, 66, 32, 50, 46, 48,
|
|
|
|
50, 45, 50, 117, 98, 117, 110, 116, 117, 56, 46, 50, 48, 0, 0, 0,
|
|
|
|
10, 0, 0, 0, 28, 0, 0, 0, 2, 1, 0, 240, 207, 212, 0, 0,
|
|
|
|
0, 240, 0, 240, 3, 0, 240, 255, 240, 255, 240, 255, 1, 0, 0, 0,
|
|
|
|
3, 0, 0, 0, 29, 0, 0, 0, 0, 32, 16, 0, 156, 50, 16, 0,
|
|
|
|
104, 101, 108, 108, 111, 32, 109, 111, 100, 117, 108, 101, 0, 131, 255, 16,
|
|
|
|
3, 0, 0, 0, 17, 0, 0, 0, 0, 64, 16, 0, 84, 82, 16, 0,
|
|
|
|
0, 232, 99, 9, 0, 0, 235, 53, 6, 0, 0, 0, 160, 0, 0, 0,
|
|
|
|
24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
0, 252, 9, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
0, 252, 9, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0,
|
|
|
|
2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0,
|
|
|
|
0, 0, 1, 0, 0, 0, 0,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|
|
82, 83, 68, 32, 80, 84, 82, 32, 60, 66, 79, 67, 72, 83, 32, 0,
|
|
|
|
252, 21, 254, 7, 236, 0, 0, 235, 0, 0, 0, 0, 8, 0, 0, 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2020-11-29 07:57:34 -05:00
|
|
|
assert(KernAux_Multiboot2_is_valid(
|
|
|
|
(struct KernAux_Multiboot2*)multiboot2_example
|
|
|
|
));
|
|
|
|
|
2020-11-28 16:24:50 -05:00
|
|
|
KernAux_Multiboot2_print(
|
|
|
|
(struct KernAux_Multiboot2*)multiboot2_example,
|
|
|
|
(void (*)(const char *format, ...))printf
|
|
|
|
);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|