mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-05 02:38:31 +00:00
Bare metal VGA: implement "status report" escape codes (#613)
* Bare metal VGA: implement "status report" escape codes * Minor fix to pseudoteletypewriter code Co-authored-by: tkchia <tkchia-cosmo@gmx.com>
This commit is contained in:
parent
e0fabd1d49
commit
df08b541af
8 changed files with 113 additions and 10 deletions
|
@ -20,15 +20,29 @@
|
|||
#include "libc/calls/struct/fd.internal.h"
|
||||
#include "libc/calls/struct/iovec.h"
|
||||
#include "libc/calls/struct/iovec.internal.h"
|
||||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/vga/vga.internal.h"
|
||||
|
||||
ssize_t sys_readv_metal(struct Fd *fd, const struct iovec *iov, int iovlen) {
|
||||
int i;
|
||||
size_t got, toto;
|
||||
struct MetalFile *file;
|
||||
switch (fd->kind) {
|
||||
case kFdConsole:
|
||||
/*
|
||||
* The VGA teletypewriter code may wish to send out "status report"
|
||||
* escape sequences, in response to requests sent to it via write().
|
||||
* Read & return these if they are available.
|
||||
*/
|
||||
if (weaken(sys_readv_vga)) {
|
||||
ssize_t res = weaken(sys_readv_vga)(fd, iov, iovlen);
|
||||
if (res > 0)
|
||||
return res;
|
||||
}
|
||||
/* fall through */
|
||||
case kFdSerial:
|
||||
return sys_readv_serial(fd, iov, iovlen);
|
||||
case kFdFile:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue