kernel: implement tty driver system

This commit is contained in:
2023-06-10 21:41:07 +01:00
parent e10f11af88
commit d09ad5838e
9 changed files with 198 additions and 54 deletions

View File

@@ -11,6 +11,7 @@
struct device;
struct input_event;
struct tty_device;
#define DEV_NAME_MAX OBJECT_NAME_MAX
#define DEV_MAJOR_MAX 1024
@@ -79,6 +80,8 @@ struct block_device {
struct char_device {
struct char_device_ops *c_ops;
/* only valid for TTY devices */
struct tty_device *c_tty;
};
struct net_device {
@@ -245,7 +248,8 @@ extern kern_status_t driver_add_device(struct driver *driver, struct device *dev
extern kern_status_t driver_remove_device(struct driver *driver, struct device *dev);
extern struct driver *system_driver(void);
extern kern_status_t framebuffer_get_varinfo(struct device *dev, struct framebuffer_varinfo *varinfo);
extern kern_status_t framebuffer_get_fixedinfo(struct device *dev, struct framebuffer_fixedinfo *out);
extern kern_status_t framebuffer_get_varinfo(struct device *dev, struct framebuffer_varinfo *out);
extern kern_status_t framebuffer_set_varinfo(struct device *dev, const struct framebuffer_varinfo *varinfo);
static inline void driver_lock(struct driver *driver)