boot: fix crash on early memory allocations

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-08-11 18:29:51 -04:00
commit 1d1dad34ce
10 changed files with 120 additions and 32 deletions

View file

@ -39,7 +39,7 @@ struct block_device {
ssize_t block_read(struct block_device *dev, char *buf, size_t offset, size_t n_blocks);
ssize_t block_write(struct block_device *dev, const char *buf, size_t offset, size_t n_blocks);
int block_device_register(char *name, size_t lba_start, struct block_ops *ops, struct block_device **out);
int block_check_partitions(struct block_device *bdev);
#endif /* _BLOCK_H_ */

View file

@ -3,6 +3,21 @@
#define _TTY_H_
#include <kernel/device.h>
#include <kernel/proc.h>
#include <lib/ringbuf.h>
#define NCCS 20
typedef u32 tcflag_t;
typedef char cc_t;
struct termios {
tcflag_t c_iflag;
tcflag_t c_oflag;
tcflag_t c_cflag;
tcflag_t c_lflag;
cc_t c_cc[NCCS];
};
struct tty_serial_ops {
void (*serial_putchar)(struct tty *tty, char c);
@ -11,8 +26,12 @@ struct tty_serial_ops {
struct tty {
dev_t dev;
void *priv;
void *priv;
struct tty_serial_ops serial_ops;
struct ringbuf *input_buf;
struct ringbuf *output_buf;
pid_t fg_proc;
};
struct tty *tty_create(const char *name, void *priv);