Browse Source

VKernel: forward stdin using VSYSCALL_READ

feature/VKernel
minexew 2 years ago
parent
commit
684529b0ce
  1. 27
      VKernel/Message.diff
  2. 1
      VKernel/VKernel.script
  3. 1
      VKernel/apply-patches.sh
  4. 1
      VKernel/make-patches.sh

27
VKernel/Message.diff

@ -0,0 +1,27 @@
diff --git a/../TempleOS/TempleOSCD/Kernel/SerialDev/Message.HC b/Patched/Kernel/SerialDev/Message.HC
index e94f246..978557f 100644
--- a/../TempleOS/TempleOSCD/Kernel/SerialDev/Message.HC
+++ b/Patched/Kernel/SerialDev/Message.HC
@@ -143,6 +143,14 @@ I64 GetKey(I64 *_scan_code=NULL,Bool echo=FALSE,Bool raw_cursor=FALSE)
{//Waits for $LK,"MSG_KEY_DOWN",A="MN:MSG_KEY_DOWN"$ message and returns $LK,"ASCII",A="MN:CH_CTRLA"$.
//Sets $LK,"scan_code",A="FI:::/Doc/CharOverview.DD"$.
//$LK,"ScanKey",A="MN:ScanKey"$() throws away other message types.
+ U8 ch;
+ if (VSysCall(VSYSCALL_READ, 0, &ch, 1)) {
+ return ch;
+ }
+ else {
+ return 0;
+ }
+ /*
I64 ch,sc;
Bool cursor_on=FALSE;
while (!ScanKey(&ch,&sc,FALSE)) {
@@ -177,6 +185,7 @@ I64 GetKey(I64 *_scan_code=NULL,Bool echo=FALSE,Bool raw_cursor=FALSE)
PutKey(ch,sc);
if (_scan_code) *_scan_code=sc;
return ch;
+ */
}
I64 GetChar(I64 *_scan_code=NULL,Bool echo=TRUE,Bool raw_cursor=FALSE)

1
VKernel/VKernel.script

@ -16,6 +16,7 @@ put /Kernel/Mem/BlkPool.HC.Z Patched/Kernel/Mem/BlkPool.HC
put /Kernel/Mem/MemPhysical.HC.Z Patched/Kernel/Mem/MemPhysical.HC
put /Kernel/MultiProc.HC.Z Patched/Kernel/MultiProc.HC
put /Kernel/Sched.HC.Z Patched/Kernel/Sched.HC
put /Kernel/SerialDev/Message.HC.Z Patched/Kernel/SerialDev/Message.HC
put /Kernel/VKMain.HC.Z VKMain.HC
put /Kernel/VKStart64.HC.Z VKStart64.HC

1
VKernel/apply-patches.sh

@ -22,5 +22,6 @@ patch $FLAGS -i KUtils.diff
patch $FLAGS -i KernelA.diff
patch $FLAGS -i MakeBlkDev.diff
patch $FLAGS -i MemPhysical.diff
patch $FLAGS -i Message.diff
patch $FLAGS -i MultiProc.diff
patch $FLAGS -i Sched.diff

1
VKernel/make-patches.sh

@ -21,3 +21,4 @@ git diff $FLAGS "$PURE_DIR/Kernel/Mem/BlkPool.HC" "$PATCHED_DIR/Kernel/Mem/BlkPo
git diff $FLAGS "$PURE_DIR/Kernel/Mem/MemPhysical.HC" "$PATCHED_DIR/Kernel/Mem/MemPhysical.HC" >MemPhysical.diff
git diff $FLAGS "$PURE_DIR/Kernel/MultiProc.HC" "$PATCHED_DIR/Kernel/MultiProc.HC" >MultiProc.diff
git diff $FLAGS "$PURE_DIR/Kernel/Sched.HC" "$PATCHED_DIR/Kernel/Sched.HC" >Sched.diff
git diff $FLAGS "$PURE_DIR/Kernel/SerialDev/Message.HC" "$PATCHED_DIR/Kernel/SerialDev/Message.HC" >Message.diff

Loading…
Cancel
Save