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

9 Commits

Author SHA1 Message Date
Achilleas Anagnostopoulos
f1cf7466c7 Revert "kfmt: fix bug where calls to copy() resulted in garbage being copied"
This reverts commit 8f04deadc1f1620dbd0aaea07f04a6c7f82f58c0.

The actual issue was triggered by a memory corruption due to the fact
that the exception handling gate code did not preserve XMM regs.
2018-04-27 19:26:08 +01:00
Achilleas Anagnostopoulos
8f04deadc1 kfmt: fix bug where calls to copy() resulted in garbage being copied
The bug manifested itself as a series of null bytes appearing to the
tty device when the ring buffer gets linked to it and its contents are
flushed to the tty.

Using gdb, I was able to track the problem into the ringbuf's Read
method and specifically to the call to copy(). I have replaced the call
with a for loop that the compiler would anyway optimize into a rep stosb
or equivalent asm instruction.
2018-03-28 07:25:52 +01:00
Achilleas Anagnostopoulos
1b697fd125 Pass PrefixWriter with driver name and version to DriverInit calls 2017-07-08 22:09:19 +01:00
Achilleas Anagnostopoulos
da279cf3ff Implement PrefixWriter
PrefixWriter is a passthrough io.Writer that prepends a prefix to the
beginning of each line.
2017-07-08 22:09:13 +01:00
Achilleas Anagnostopoulos
eca1f6c26e Change early.Printf calls to kfmt.Printf 2017-07-07 21:37:00 +01:00
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
d8793bd530 Move kernel panic implementation to the kfmt package 2017-07-07 06:25:24 +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