mostly improvements to malloc

This commit is contained in:
2025-07-01 11:20:04 -07:00
parent 109e554524
commit e1e30b511a
15 changed files with 276 additions and 30 deletions

View File

@@ -1,9 +1,9 @@
#include "vga.h"
#include <stddef.h>
#include <stdbool.h>
#include <stdio.h> // Include for vsnprintf
#include <string.h> // Include for strlen
#include <stdarg.h> // Include for va_list, va_start, etc.
#include <string.h>
#include <stdarg.h>
#include "string_utils.h"
void outb(uint16_t port, uint8_t value) {
__asm__ volatile("outb %0, %1" : : "a"(value), "Nd"(port));
@@ -130,11 +130,11 @@ void vga_printf(const char* format, ...) {
char buffer[256]; // Buffer to store the formatted string
va_list args;
va_start(args, format);
vsnprintf(buffer, sizeof(buffer), format, args);
my_vsnprintf(buffer, sizeof(buffer), format, args); // Use my_vsnprintf instead of vsnprintf
va_end(args);
// Now you can use the buffer with vga_write_string
vga_write_string(buffer, strlen(buffer));
vga_write_string(buffer, my_strlen(buffer)); // Use my_strlen instead of strlen
}
void vga_init(void) {