FujiNetWIFI / fujinet-nhandler

Atari N: Handler for FujiNet
GNU General Public License v3.0
7 stars 9 forks source link

NOS: AUTORUN function #14

Open DaBaDa79 opened 1 year ago

DaBaDa79 commented 1 year ago

When NOS is booting up no drives are mapped by default. So the first thing one must do is always NCDing to the "working directory" of choice (or load by full URL directly). Both ways are somewhat cumbersome. For example the first thing after booting I do are these three commands: NCD TNFS://TWIX/OSM/ NTRANS 3 CAR This way I can cross develop my BASIC files on my PC and on the ATARI/Altirra. It would by nice to have the NOS do some kind of autorun (like other DOSes). As NOS supports batch files ideally it could automatically fetch a file called AUTORUN.BAT from a user defined TNFS server.

DaBaDa79 commented 1 year ago

For test purposes I added this to my local development branch - it works but should be reviewed by someone with more experience in OS development.

My current way of doing it:

  1. added a command "AUTORUN" (id #27) which fetches an URL via appkey (db790000.key), sets NTRANS to 3 and then does a SOURCE with the fetched URL
  2. injected the AUTORUN command at the entry point of DOS (just before the CP loop)
  3. added a DNS to my router for the hostname BOOT.TNFS (alias for my TNFS server)

Problem right now:

  1. When booting with BASIC enabled, NOS jumps into it without calling AUTORUN, I can just type DOS and it is called once (and because of the CAR command in my batch file it comes back to BASIC)
  2. When booting without BASIC enabled, NOS calls the AUTORUN but now the CAR command is not working anymore so I have to load BASIC myself. Therefore I have added a line which does this.

So in the end my AUTORUN.BAT looks like this: NCD TNFS://TWIX/OSM/ NTRANS 3 CAR LOAD ALTBASIC.COM

The right way surely would be to call the AUTORUN not at the beginning of the command processor but before the initial jump to the cartridge/BASIC. But I couldn't find the place in the code where this is done.

tschak909 commented 1 year ago

I pulled it in. thank you so much! We can refine this to make it even better! :)

-Thom

On Sun, Oct 16, 2022 at 5:16 AM DaBaDa79 @.***> wrote:

For test purposes I added this to my local development branch - it works but should be reviewed by someone with more experience in OS development.

My current way of doing it:

  1. added a command "AUTORUN" (id #27) which does NTRANS 3 SOURCE TNFS://BOOT.TNFS/AUTORUN/AUTORUN.BAT
  2. injected the AUTORUN command at the entry point of DOS (just before the CP loop)
  3. added a DNS to my router for the hostname BOOT.TNFS (alias for my TNFS server)

Problem right now:

  1. When booting with BASIC enabled, NOS jumps into it without calling AUTORUN, I can just type DOS and it is called once (and because of the CAR command in my batch file it comes back to BASIC)
  2. When booting without BASIC enabled, NOS calls the AUTORUN but now the CAR command is not working anymore so I have to load BASIC myself. Therefore I have added a line which does this.

So in the end my AUTORUN.BAT looks like this: NCD TNFS://TWIX/OSM/ NTRANS 3 CAR LOAD ALTBASIC.COM

The right way surely would be to call the AUTORUN not at the beginning of the command processor but before the initial jump to the cartridge/BASIC. But I couldn't find the place in the code where this is done.

— Reply to this email directly, view it on GitHub https://github.com/FujiNetWIFI/fujinet-nhandler/issues/14#issuecomment-1279938693, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVBYZXGC2LARDPUEFSDCYTWDPIXBANCNFSM6AAAAAARGJCMMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>