working dos vga writes!

This commit is contained in:
veclavtlica committed 2026-10-29 22:12:47 +03:00
1 parent 5789cafd4e
commit 55ac075e4d
25 files changed
+454 -149

No files matched your search

+2 -1
View File
@@ -1,5 +1,4 @@
#include "../std.h"
#include "any.c"
#include <assert.h>
#include <poll.h>
#include <stdarg.h>
@@ -10,6 +9,8 @@
#include <sys/un.h>
#include <tgmath.h>
#include "any.c"
void *com_std_alloc(void *ptr, size_t size) {
return size != 0 ? realloc(ptr, size) : (free(ptr), NULL);
}
+16
View File
@@ -24,6 +24,8 @@ size_t strlen(char const *s) {
return p - s;
}
#if COM_DEF_CPU == COM_DEF_CPU_AMD64 || COM_DEF_CPU == COM_DEF_CPU_X86
double sin(double v) {
double r;
__asm__ __volatile__("fsin" : "=t"(r) : "0"(v));
@@ -49,3 +51,17 @@ double sqrt(double v) {
__asm__ volatile("sqrtss %1, %0" : "=x"(r) : "x"(v));
return r;
}
#else
double sin(double v) { return __builtin_sin(v); }
double cos(double v) { return __builtin_cos(v); }
void sincos(double v, double *s, double *c) {
return __builtin_sincos(v, s, c);
}
double sqrt(double v) { return __builtin_sqrt(v); }
#endif
+2 -12
View File
@@ -1,23 +1,13 @@
#include "../std.h"
#include "any.c"
#include "nolibc.c"
#include <stdbool.h>
#include <stddef.h>
void *com_std_alloc(void *ptr, size_t size) { return NULL; }
double com_std_sqrt(double v) { return __builtin_sqrt(v); }
double com_std_fabs(double v) { return __builtin_fabs(v); }
#if COM_DEF_COMPILER == COM_DEF_COMPILER_CLANG
double com_std_sin(double v) { return __builtin_sin(v); }
double com_std_cos(double v) { return __builtin_cos(v); }
#else
/* TODO: Use fsin/fcos, no matter how slow. */
double com_std_sin(double v) { return 0; }
double com_std_cos(double v) { return 0; }
#endif
com_std_fd com_std_open(char const *path, uint32_t flags) { return NULL; }
bool com_std_write(com_std_fd fd, void const *data, uint32_t bytes) {
return false;
@@ -28,7 +18,7 @@ com_std_fd com_std_socket(bool isnetwork) { return NULL; }
bool com_std_connect(com_std_fd fd, bool isnetwork, char const *address) {
return false;
}
void com_std_exit(uint32_t status) {
void com_std_exit(int32_t status) {
__builtin_trap();
while (1) {
}