2020-12-07 04:47:53 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2022-12-09 02:59:54 +00:00
|
|
|
#define KERNAUX_ACCESS_PROTECTED
|
|
|
|
|
|
|
|
#include <kernaux/generic/display.h>
|
|
|
|
#include <kernaux/macro.h>
|
2020-11-28 21:24:50 +00:00
|
|
|
#include <kernaux/multiboot2.h>
|
|
|
|
|
2020-11-29 12:57:34 +00:00
|
|
|
#include <assert.h>
|
2022-02-02 03:09:54 +00:00
|
|
|
#include <stdarg.h>
|
2020-11-28 21:24:50 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2022-01-13 04:05:34 +00:00
|
|
|
#include "multiboot2_info_example1.h"
|
2020-11-28 21:24:50 +00:00
|
|
|
|
2022-12-09 02:59:54 +00:00
|
|
|
static void my_putc(void *display KERNAUX_UNUSED, char c)
|
|
|
|
{
|
|
|
|
putchar(c);
|
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
void my_vprintf(void *display KERNAUX_UNUSED, const char *format, va_list va)
|
2022-02-02 03:09:54 +00:00
|
|
|
{
|
|
|
|
vprintf(format, va);
|
|
|
|
}
|
|
|
|
|
2022-12-09 02:59:54 +00:00
|
|
|
static const struct KernAux_Display display = {
|
|
|
|
.putc = my_putc,
|
|
|
|
.vprintf = my_vprintf,
|
|
|
|
};
|
|
|
|
|
2022-06-20 18:01:56 +00:00
|
|
|
void test_main()
|
2020-11-28 21:24:50 +00:00
|
|
|
{
|
2022-01-13 03:59:52 +00:00
|
|
|
assert(KernAux_Multiboot2_Info_is_valid(
|
2022-01-13 04:05:34 +00:00
|
|
|
(struct KernAux_Multiboot2_Info*)multiboot2_info_example1
|
2020-11-29 12:57:34 +00:00
|
|
|
));
|
|
|
|
|
2022-01-13 03:59:52 +00:00
|
|
|
KernAux_Multiboot2_Info_print(
|
2022-01-13 04:05:34 +00:00
|
|
|
(struct KernAux_Multiboot2_Info*)multiboot2_info_example1,
|
2022-12-09 02:59:54 +00:00
|
|
|
&display
|
2020-11-28 21:24:50 +00:00
|
|
|
);
|
|
|
|
}
|