x86 support!
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
|
||||
/* No libc starting point. Jump straight into action! */
|
||||
__attribute__((naked)) __attribute__((force_align_arg_pointer))
|
||||
__attribute__((noreturn)) extern void
|
||||
_start(void) {
|
||||
__asm__ volatile("xorl %ebp, %ebp\n"
|
||||
"movl (%esp), %ecx\n"
|
||||
"leal 4(%esp), %edx\n"
|
||||
|
||||
/* 3. Align the stack pointer to a 16-byte boundary */
|
||||
"andl $-16, %esp\n"
|
||||
|
||||
/* 4. Reserve stack space for main's arguments + padding
|
||||
We need to pass 2 arguments (8 bytes).
|
||||
To keep %esp 16-byte aligned before the "call",
|
||||
we allocate 16 bytes total. */
|
||||
"subl $16, %esp\n"
|
||||
|
||||
/* 5. Place arguments onto the newly aligned stack */
|
||||
"movl %ecx, (%esp)\n"
|
||||
"movl %edx, 4(%esp)\n"
|
||||
"call plr_display_x11_main\n"
|
||||
"movl %eax, %ebx\n"
|
||||
"movl $1, %eax\n"
|
||||
"int $0x80");
|
||||
}
|
||||
+6
-1
@@ -12,10 +12,15 @@
|
||||
#include "./draw.c"
|
||||
|
||||
#if COM_DEF_TARGET == COM_DEF_TARGET_LINUX
|
||||
#if COM_DEF_CPU == COM_DEF_CPU_AMD64
|
||||
#include "../Common/Std/linux-amd64.c"
|
||||
#include "./Main/linux-amd64.c"
|
||||
#elif COM_DEF_CPU == COM_DEF_CPU_X86
|
||||
#include "../Common/Std/linux-x86.c"
|
||||
#include "./Main/linux-x86.c"
|
||||
#endif
|
||||
#include "../Common/Timer/stub.c"
|
||||
#include "./Display/x11.c"
|
||||
#include "./Main/linux.c"
|
||||
// #include "./Main/libc.c"
|
||||
#elif COM_DEF_TARGET == COM_DEF_TARGET_WASM
|
||||
#include "../Common/Std/stub.c"
|
||||
|
||||
Reference in New Issue
Block a user