feat(serial): add write

Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
juju committed 2021-07-12 20:03:55 +02:00
1 parent 202fc190ac
commit e92cc8877f
2 files changed
+13 -1

No files matched your search

+11 -1
View File
@@ -22,5 +22,15 @@ void serial_init(void)
int write(const char *buf, size_t count)
{
return 0;
int sent;
for(sent = 0; sent < count; ++sent)
{
u8 line_status = inb(COM1 + 5);
if (!line_status & EMPTY_TRANSMITTER)
break;
outb(COM1, buf[sent]);
}
return sent;
}
+2
View File
@@ -18,6 +18,8 @@
#define DLAB (0x1 << 7)
#define EMPTY_TRANSMITTER (0x1 << 5)
void serial_init(void);
int write(const char *buf, size_t count);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.