Fix UTM display: remove required framebuffer tag, add serial output, ls app
Display fixes for UTM/Mac black screen issue:
- Remove MULTIBOOT_HEADER_TAG_FRAMEBUFFER from multiboot2 header (was required,
requesting text mode depth=0 which confused GRUB on some platforms)
- Add COM1 serial port (0x3F8) output alongside debugcon for UTM serial capture
- Change VGA background from black to dark blue for diagnostics
- Add early canary write to 0xB8000 ('COS' in magenta) before subsystem init
- print_hex now outputs to both debugcon and COM1
New ls command and SYS_READDIR syscall:
- SYS_READDIR (10): reads directory entries via VFS
- VFS root listing: vfs_readdir handles '/' by iterating mount table
- apps/ls: lists CWD contents, appends '/' for directories
- apps/libc/syscalls.h: readdir() wrapper
This commit is contained in:
@@ -23,6 +23,7 @@ typedef int int32_t;
|
||||
#define SYS_EXEC 7
|
||||
#define SYS_GETENV 8
|
||||
#define SYS_SETENV 9
|
||||
#define SYS_READDIR 10
|
||||
|
||||
static inline int32_t syscall0(int num) {
|
||||
int32_t ret;
|
||||
@@ -91,6 +92,17 @@ static inline int32_t setenv(const char *key, const char *value) {
|
||||
return syscall2(SYS_SETENV, (uint32_t)key, (uint32_t)value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a directory entry.
|
||||
* @param path Directory path.
|
||||
* @param idx Entry index (0-based).
|
||||
* @param name Buffer for entry name (128 bytes min).
|
||||
* @return Entry type (1=file, 2=dir) on success, -1 at end.
|
||||
*/
|
||||
static inline int32_t readdir(const char *path, uint32_t idx, char *name) {
|
||||
return syscall3(SYS_READDIR, (uint32_t)path, idx, (uint32_t)name);
|
||||
}
|
||||
|
||||
/* Basic string operations for user-space */
|
||||
static inline uint32_t strlen(const char *s) {
|
||||
uint32_t len = 0;
|
||||
|
||||
Reference in New Issue
Block a user