~vdupras/duskos-discuss

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
5 2

[PATCH] Add a reboot word to the 8042 driver.

Details
Message ID
<20221220182117.26574-1-l3gacy.b3ta@disroot.org>
DKIM signature
missing
Download raw message
Patch: +6 -0
Signed-off-by: Arcade Wise <l3gacy.b3ta@disroot.org>
---
 fs/drv/pc/ps28042.fs  | 3 +++
 fs/drv/pc/ps28042p.fs | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/fs/drv/pc/ps28042.fs b/fs/drv/pc/ps28042.fs
index e1c6f79..db9b0c8 100644
--- a/fs/drv/pc/ps28042.fs
+++ b/fs/drv/pc/ps28042.fs
@@ -28,3 +28,6 @@ code isrIRQ1

\ You need to remap the PIC before calling this
: 8042ps2$ ['] isrIRQ1 $21 setISR 0 _ridx ! 0 _widx ! ;

\ Reboot using the 8042 interface to the reset pin
: reboot $FE $64 pc! ;
diff --git a/fs/drv/pc/ps28042p.fs b/fs/drv/pc/ps28042p.fs
index af8bcc9..8d59323 100644
--- a/fs/drv/pc/ps28042p.fs
+++ b/fs/drv/pc/ps28042p.fs
@@ -6,3 +6,6 @@ $64 const PS2CMD

: 8042ps2@? ( -- keycode? f )
  PS2CMD pc@ 1 and dup if PS2DATA pc@ swap then ;

\ Reboot using the 8042 interface to the reset pin
: reboot $FE $64 pc! ;
-- 
2.38.1
Details
Message ID
<ac7ca20c-930c-40b1-ab16-adf9e8329336@app.fastmail.com>
In-Reply-To
<20221220182117.26574-1-l3gacy.b3ta@disroot.org> (view parent)
DKIM signature
missing
Download raw message
On Tue, Dec 20, 2022, at 1:21 PM, Arcade Wise wrote:
> Signed-off-by: Arcade Wise <l3gacy.b3ta@disroot.org>
> ---
>  fs/drv/pc/ps28042.fs  | 3 +++
>  fs/drv/pc/ps28042p.fs | 3 +++
>  2 files changed, 6 insertions(+)
>
> diff --git a/fs/drv/pc/ps28042.fs b/fs/drv/pc/ps28042.fs
> index e1c6f79..db9b0c8 100644
> --- a/fs/drv/pc/ps28042.fs
> +++ b/fs/drv/pc/ps28042.fs
> @@ -28,3 +28,6 @@ code isrIRQ1
> 
>  \ You need to remap the PIC before calling this
>  : 8042ps2$ ['] isrIRQ1 $21 setISR 0 _ridx ! 0 _widx ! ;
> +
> +\ Reboot using the 8042 interface to the reset pin
> +: reboot $FE $64 pc! ;
> diff --git a/fs/drv/pc/ps28042p.fs b/fs/drv/pc/ps28042p.fs
> index af8bcc9..8d59323 100644
> --- a/fs/drv/pc/ps28042p.fs
> +++ b/fs/drv/pc/ps28042p.fs
> @@ -6,3 +6,6 @@ $64 const PS2CMD
> 
>  : 8042ps2@? ( -- keycode? f )
>    PS2CMD pc@ 1 and dup if PS2DATA pc@ swap then ;
> +
> +\ Reboot using the 8042 interface to the reset pin
> +: reboot $FE $64 pc! ;
> -- 
> 2.38.1

I see you're cozying up, good :) I don't think resetting through the 8042 is
that easy though. In QEMU, when I reboot this way, the keyboard stops working
after the reboot. Doesn't it do the same for you?

On osdev, I see some references to A20 line caveats.

Also, I wouldn't add such convenience the the "poll" driver. That driver is only
there for hardware debugging purposes and shouldn't include conveniences. The
real 8042 driver is the IRQ-based one.

Regards,
Virgil
Details
Message ID
<95DF143C-6D33-48B1-B2E6-C71BEE3DA1B8@disroot.org>
In-Reply-To
<ac7ca20c-930c-40b1-ab16-adf9e8329336@app.fastmail.com> (view parent)
DKIM signature
missing
Download raw message


>I see you're cozying up, good :) 

Haha yeah, it's fun to hack on ;3


> I don't think resetting through the 8042 is
>that easy though. In QEMU, when I reboot this way, the keyboard stops working
>after the reboot. Doesn't it do the same for you?

I'm not at my laptop, but I swear it worked. I'll do some debugging

>On osdev, I see some references to A20 line caveats.

I'll look into that!

>Also, I wouldn't add such convenience the the "poll" driver. That driver is only
>there for hardware debugging purposes and shouldn't include conveniences. The
>real 8042 driver is the IRQ-based one.

Fair!
Details
Message ID
<0ccf3e75-7174-5347-2a06-0a2dfd2a02dd@disroot.org>
In-Reply-To
<ac7ca20c-930c-40b1-ab16-adf9e8329336@app.fastmail.com> (view parent)
DKIM signature
missing
Download raw message
> I see you're cozying up, good :)
Haha yeah, dusk is nice to hack on :3

  I don't think resetting through the 8042 is
> that easy though. In QEMU, when I reboot this way, the keyboard stops working
> after the reboot. Doesn't it do the same for you?

Nope! But if you type before the information thingy "Dusk OS XXXXKB used 
XXMB free ok" the keyboard freezes and doesn't work.

> On osdev, I see some references to A20 line caveats.

Hm, I'll look into that.

> Also, I wouldn't add such convenience the the "poll" driver. That driver is only
> there for hardware debugging purposes and shouldn't include conveniences. The
> real 8042 driver is the IRQ-based one.

I'll fix that! that makes sense.

-- 
Arcade Wise (they/them)
<arcades.agency>
Details
Message ID
<b24c3f8d-6b8f-4e0e-9f69-f6f0ba1f5cd7@app.fastmail.com>
In-Reply-To
<0ccf3e75-7174-5347-2a06-0a2dfd2a02dd@disroot.org> (view parent)
DKIM signature
missing
Download raw message
On Wed, Dec 21, 2022, at 12:12 PM, Arcade Wise wrote:
> Nope! But if you type before the information thingy "Dusk OS XXXXKB used 
> XXMB free ok" the keyboard freezes and doesn't work.

Oh, it's true. I hadn't noticed it. I'll fix this and then try the reboot patch
again.
Details
Message ID
<52B48CA7-A246-4EE0-B7DA-99088826F5E5@disroot.org>
In-Reply-To
<b24c3f8d-6b8f-4e0e-9f69-f6f0ba1f5cd7@app.fastmail.com> (view parent)
DKIM signature
missing
Download raw message
>Oh, it's true. I hadn't noticed it. I'll fix this and then try the reboot patch
>again.

np! If you need any other fixes, this seems to be the best till we potentially have ACPI
Reply to thread Export thread (mbox)