Skip to content

[reset] Adding reboot function by shutdown -r to PC-98#2416

Merged
ghaerr merged 3 commits intoghaerr:masterfrom
tyama501:pc98_reboot
Oct 23, 2025
Merged

[reset] Adding reboot function by shutdown -r to PC-98#2416
ghaerr merged 3 commits intoghaerr:masterfrom
tyama501:pc98_reboot

Conversation

@tyama501
Copy link
Copy Markdown
Contributor

Hello @ghaerr and @drachen6jp

This is the PR to add the shutdown -r reboot function for PC-98 by @drachen6jp .

I have cherry-picked his commit, then I have added reset-pc98.c and moved the function from the reset-stub.c.

I have confirmed it work with NP2 emulator.

Thank you!

@ghaerr
Copy link
Copy Markdown
Owner

ghaerr commented Oct 22, 2025

Hello @tyama501,

Is there a chance you could rewrite using more readable C macros, something similar to reset-swan.c? This would allow the possible use of additional defines to use as port numbers or data constants as self-documentation. This would allow much easier understanding of what is being done. Something like:

#define PORT_CTRL  0x37  /* control port for ... */
#define PORT_xxxx  0xF0  /* special port for ... */

    outb(0x0B, PORT_CTRL);    /* send ... to ... control */
    outb(0x0F, PORT_CTRL);
    if (inb(0xF0) & 2)       /* V30 */
        outb(0x07, 0xF0);    /* send .. to ... control */
    else outb(0x00, 0xF0);
    asm("ljmp $0xFFFF,$0\n");

I realize that reset-ism.c is written all ASM, but the reason for that is that INT 15h is executed, for which there are no predefined macros to load registers beforehand.

Thank you!

@tyama501
Copy link
Copy Markdown
Contributor Author

Hello @ghaerr

I have rewritten it.

Thank you.

@ghaerr
Copy link
Copy Markdown
Owner

ghaerr commented Oct 23, 2025

Nice, thank you!

@ghaerr ghaerr merged commit 8302457 into ghaerr:master Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants