dthain / basekernel

A simple OS kernel for research, teaching, and fun.
GNU General Public License v2.0
798 stars 110 forks source link

Fix serial_read function to actually return the character #287

Closed DevHyperCoder closed 11 months ago

DevHyperCoder commented 11 months ago

Currently serial_read calls inb but doesn't return the character. This commit fixes that.

Sorry if I should create an issue instead, but I don't see any way for user programs to access the serial. Is there something I have missed ? (If it doesn't exist, its fine, I can hack on it)

dthain commented 11 months ago

Hello, thanks for the PR. That is definitely a bug. The serial code is not currently hooked up to anything else, which would explain why that wasn't found.

If you would like to get the serial driver going, I think the way to proceed would be register it as a device driver (see example of this in ata_init) and then add a new system call open_serial that calls device_open and then kobject_create to attach it to a file object.

Thanks!