2022-10-06 12:36:15 +00:00
|
|
|
#if 0
|
|
|
|
/*─────────────────────────────────────────────────────────────────╗
|
|
|
|
│ To the extent possible under law, Justine Tunney has waived │
|
|
|
|
│ all copyright and related or neighboring rights to this file, │
|
|
|
|
│ as it is written in the following disclaimers: │
|
|
|
|
│ • http://unlicense.org/ │
|
|
|
|
│ • http://creativecommons.org/publicdomain/zero/1.0/ │
|
|
|
|
╚─────────────────────────────────────────────────────────────────*/
|
|
|
|
#endif
|
|
|
|
#include "libc/calls/calls.h"
|
|
|
|
#include "libc/calls/termios.h"
|
|
|
|
#include "libc/isystem/unistd.h"
|
|
|
|
#include "libc/math.h"
|
|
|
|
#include "libc/stdio/stdio.h"
|
|
|
|
#include "libc/str/str.h"
|
|
|
|
#include "libc/sysv/consts/termios.h"
|
|
|
|
|
2023-05-13 05:42:57 +00:00
|
|
|
#ifdef __x86_64__
|
|
|
|
|
2022-10-06 12:36:15 +00:00
|
|
|
/**
|
|
|
|
* @fileoverview Demo of program crash reporting with Bare Metal VGA TTY.
|
|
|
|
*
|
|
|
|
* make -j8 o//examples/vga2.com
|
|
|
|
* qemu-system-x86_64 -hda o//examples/vga2.com -serial stdio
|
|
|
|
*/
|
|
|
|
|
2023-07-26 20:54:49 +00:00
|
|
|
__static_yoink("vga_console");
|
|
|
|
__static_yoink("_idt");
|
2023-10-25 21:32:20 +00:00
|
|
|
__static_yoink("_AcpiMadtFlags");
|
|
|
|
__static_yoink("_AcpiBootFlags");
|
2023-07-26 20:54:49 +00:00
|
|
|
__static_yoink("EfiMain");
|
2022-10-06 12:36:15 +00:00
|
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
2022-12-18 01:51:20 +00:00
|
|
|
int i;
|
2022-10-06 12:36:15 +00:00
|
|
|
volatile int x = 1;
|
|
|
|
volatile int y = 2;
|
2022-12-18 01:51:20 +00:00
|
|
|
printf("argc = %d\n", argc);
|
|
|
|
for (i = 0; i < argc; ++i) {
|
|
|
|
printf("argv[%d] = \"%s\"\n", i, argv[i]);
|
|
|
|
}
|
2022-10-06 12:36:15 +00:00
|
|
|
printf("\e[92;44mHello World!\e[0m %d\n", 1 / (x + y - 3));
|
2023-05-13 05:42:57 +00:00
|
|
|
for (;;)
|
|
|
|
;
|
2022-10-06 12:36:15 +00:00
|
|
|
}
|
2023-05-13 05:42:57 +00:00
|
|
|
|
|
|
|
#endif /* __x86_64__ */
|