1
0
mirror of https://github.com/taigrr/gopher-os synced 2025-01-18 04:43:13 -08:00

14 Commits

Author SHA1 Message Date
Achilleas Anagnostopoulos
545a18fccc Support pluggable output sinks for Printf with a ring-buffer fallback
The implementation of Printf has been moved from the early package to
the kfmt package. The dependency to ActiveTerminal has been removed and
the code now uses an io.Writer for its output. As Go interfaces cannot
be used before bootstrapping the Go runtime, the code uses a ring-buffer
fallback for storing any kernel output emitted before that point.
2017-07-07 21:37:00 +01:00
Achilleas Anagnostopoulos
f691d75b29 Implement ring-buffer for capturing early printf output
The ring-buffer implements both io.Reader and io.Writer and uses a fixed
size of 2048 bytes (set by the ringBufferSize constant). This provides
enough space to hold a standard 80x25 screen's output.
2017-07-07 21:37:00 +01:00
Achilleas Anagnostopoulos
0f3af2e78d Refactor VT implementation
This commit refactors the old VT implementation to work with the revised
TTY interface and adds support for:
- scrollback
- terminal state handling

When a terminal becomes activated, it overwrites the attached console
contents with the contents of its viewport.
2017-07-07 21:37:00 +01:00
Achilleas Anagnostopoulos
78c87ab165 Cleanup and revise TTY interface 2017-07-07 21:37:00 +01:00
Achilleas Anagnostopoulos
286b8d9c71 Rename Ega console to VgaTextConsole and implement the updated interface 2017-07-07 21:36:50 +01:00
Achilleas Anagnostopoulos
b72725742a Revise console interface 2017-07-07 06:25:24 +01:00
Achilleas Anagnostopoulos
425ad7319b Define driver interface
This interface must be implemented by all device drivers in the driver
sub-packages.
2017-07-07 06:25:24 +01:00
Achilleas Anagnostopoulos
d8793bd530 Move kernel panic implementation to the kfmt package 2017-07-07 06:25:24 +01:00
Achilleas Anagnostopoulos
dc37e86421 Run the init() function for all kernel packages and their dependencies
Things like error messages (e.g in the io pkg) are actually allocated
when init() is executed. Unless we trigger a call to init(), values like
this will be nil causing various problems when we try to use functions
from the stdlib.
2017-07-07 06:25:24 +01:00
Achilleas Anagnostopoulos
0bbaa1dbff Use correct FP offset for fetching the values passed to cpu.PortWriteXXX 2017-07-05 17:09:19 +01:00
Achilleas Anagnostopoulos
40521f8626 Ensure that the memory returned by sysAlloc is always zeroed 2017-07-05 16:50:59 +01:00
Achilleas Anagnostopoulos
4f3312b85d Implement functions for reading/writing from/to IO ports 2017-07-02 19:21:09 +01:00
Achilleas Anagnostopoulos
e4879b9f8a Support the CPUID instruction 2017-07-02 19:21:04 +01:00
Achilleas Anagnostopoulos
8dfc5d4e92 Use pwd as a workspace; move sources to src/gopheros and rewrite imports
By setting up pwd as a Go workspace, we can trim import paths from
something like "github.com/achilleasa/gopher-os/kernel" to just
"kernel".

These changes make forking easier and also allows us to move the code to
a different git hosting provider without having to rewrite the imports.
2017-07-01 20:37:09 +01:00