test: Minor changes

This commit is contained in:
mintsuki 2022-03-17 22:47:58 +01:00
parent 50076656f4
commit ee5e776c2c
4 changed files with 16 additions and 23 deletions

View File

@ -1,5 +1,5 @@
CC = cc
CFLAGS = -O2 -g
CFLAGS = -O2 -g -Wall -Wextra -Wpedantic
LDFLAGS =
LD = ld
QEMU = qemu-system-x86_64
@ -32,7 +32,7 @@ INTERNALCFLAGS := \
-I../stivale \
-I. \
-I../common \
-std=gnu11 \
-std=c11 \
-ffreestanding \
-fno-stack-protector \
-fpie \

View File

@ -8,7 +8,7 @@ static const char CONVERSION_TABLE[] = "0123456789abcdef";
void e9_putc(char c) {
if (stivale2_print != NULL)
stivale2_print(&c, 1);
asm volatile ("outb %0, %1" :: "a" (c), "Nd" (0xe9) : "memory");
__asm__ __volatile__ ("outb %0, %1" :: "a" (c), "Nd" (0xe9) : "memory");
}
void e9_print(const char *msg) {

View File

@ -5,46 +5,39 @@
static void limine_main(void);
__attribute__((used))
static struct limine_framebuffer_request framebuffer_request = {
.id = LIMINE_FRAMEBUFFER_REQUEST,
.flags = 0, .response = NULL
};
__attribute__((used))
static struct limine_entry_point_request entry_point_request = {
struct limine_entry_point_request entry_point_request = {
.id = LIMINE_ENTRY_POINT_REQUEST,
.flags = 0, .response = NULL,
.entry = limine_main
};
__attribute__((used))
static struct limine_boot_info_request boot_info_request = {
struct limine_framebuffer_request framebuffer_request = {
.id = LIMINE_FRAMEBUFFER_REQUEST,
.flags = 0, .response = NULL
};
struct limine_boot_info_request boot_info_request = {
.id = LIMINE_BOOT_INFO_REQUEST,
.flags = 0, .response = NULL
};
__attribute__((used))
static struct limine_memmap_request memmap_request = {
struct limine_memmap_request memmap_request = {
.id = LIMINE_MEMMAP_REQUEST,
.flags = 0, .response = NULL
};
__attribute__((used))
static struct limine_module_request module_request = {
struct limine_module_request module_request = {
.id = LIMINE_MODULE_REQUEST,
.flags = 0, .response = NULL
};
__attribute__((used))
static struct limine_rsdp_request rsdp_request = {
struct limine_rsdp_request rsdp_request = {
.id = LIMINE_RSDP_REQUEST,
.flags = 0, .response = NULL
};
__attribute__((used))
static struct limine_smbios_request smbios_request = {
struct limine_smbios_request smbios_request = {
.id = LIMINE_SMBIOS_REQUEST,
.flags = 0, .response = NULL
};

View File

@ -58,7 +58,7 @@ static volatile int cpu_up = 0;
static void ap_entry(struct stivale2_smp_info *s) {
e9_printf(" AP %d started", s->lapic_id);
cpu_up = 1;
for (;;) asm("hlt");
for (;;) __asm__("hlt");
}
static void print_guid(struct stivale2_guid guid) {
@ -277,5 +277,5 @@ void stivale2_main(struct stivale2_struct *info) {
}
// Enter our sublime pale slumber.
for (;;) asm("hlt");
for (;;) __asm__("hlt");
}