Author Topic: Boot to a telnet session?  (Read 3766 times)

Offline darthnVader

  • Moderator
  • Platinum Member
  • *****
  • Posts: 679
  • New Member
Boot to a telnet session?
« on: March 20, 2018, 06:48:25 AM »
I'm trying to figure out how to get OF to boot into a telnet session. I'm pretty sure OF supports this on a new world Mac, I know old world Mac's support it.

setting the nvramrc doesn't seem to work:

Code: [Select]
nvedit
" enet:telnet,10.1.2.3" io
nvstore
setenv use-nvramrc? true

Old world Mac's had the OF output device set to the serial port, as well as the input device, but I'm not sure how to start the telnet server?



Offline Daniel

  • Gold Member
  • *****
  • Posts: 300
  • Programmer, Hacker, Thinker
Re: Boot to a telnet session?
« Reply #1 on: March 20, 2018, 01:43:03 PM »
The nvramrc script is run way before the system is ready to open a telnet prompt. You have to set the boot-command nvram variable something that goes into a telnet prompt. I use a nvramrc script that lets me switch the boot-command variable automatically.
Code: [Select]
: tnio " enet:telnet,192.168.1.128" io ;
: rbn " mac-boot" " boot-command" $setenv reset-all ;
: rbt " tnio" " boot-command" $setenv reset-all ;
I type rbt if I want the computer to always boot to telnet.
I type rbn if I want the computer to always boot normally.

You can replace the IP address with whatever you want it to be.

I am pretty sure this will work on every New World Mac, but I only tested it on the machine I use regularly.

Offline darthnVader

  • Moderator
  • Platinum Member
  • *****
  • Posts: 679
  • New Member
Re: Boot to a telnet session?
« Reply #2 on: March 20, 2018, 04:37:02 PM »
The nvramrc script is run way before the system is ready to open a telnet prompt. You have to set the boot-command nvram variable something that goes into a telnet prompt. I use a nvramrc script that lets me switch the boot-command variable automatically.
Code: [Select]
: tnio " enet:telnet,192.168.1.128" io ;
: rbn " mac-boot" " boot-command" $setenv reset-all ;
: rbt " tnio" " boot-command" $setenv reset-all ;
I type rbt if I want the computer to always boot to telnet.
I type rbn if I want the computer to always boot normally.

You can replace the IP address with whatever you want it to be.

I am pretty sure this will work on every New World Mac, but I only tested it on the machine I use regularly.

Thanks, I'll need a little more info on how to use this, walk me through it, I'm a little confused.

As an aside, I'm having trouble with any telnet session on my Quicksilver. I can't get any input in the session, I thought I had it fixed with a crossover cable, but it only worked once, now no input in the session, no matter what I do.

Anyone ever have this trouble?

The ethernet port on QS works just fine, I can connect to it via AFP, and share the internet connection from the machine I'm trying to telnet from. I've tried a Tiger host, a Leopard host, and OS 9, all have the same issue, I get the OF prompt in the session, but no input.

I've tried direct connection via ethernet, and routing via my router, but no dice????????

Offline Daniel

  • Gold Member
  • *****
  • Posts: 300
  • Programmer, Hacker, Thinker
Re: Boot to a telnet session?
« Reply #3 on: March 20, 2018, 05:12:47 PM »
The nvramrc script is run way before the system is ready to open a telnet prompt. You have to set the boot-command nvram variable something that goes into a telnet prompt. I use a nvramrc script that lets me switch the boot-command variable automatically.
Code: [Select]
: tnio " enet:telnet,192.168.1.128" io ;
: rbn " mac-boot" " boot-command" $setenv reset-all ;
: rbt " tnio" " boot-command" $setenv reset-all ;
I type rbt if I want the computer to always boot to telnet.
I type rbn if I want the computer to always boot normally.

You can replace the IP address with whatever you want it to be.

I am pretty sure this will work on every New World Mac, but I only tested it on the machine I use regularly.

Thanks, I'll need a little more info on how to use this, walk me through it, I'm a little confused.

As an aside, I'm having trouble with any telnet session on my Quicksilver. I can't get any input in the session, I thought I had it fixed with a crossover cable, but it only worked once, now no input in the session, no matter what I do.

Anyone ever have this trouble?

The ethernet port on QS works just fine, I can connect to it via AFP, and share the internet connection from the machine I'm trying to telnet from. I've tried a Tiger host, a Leopard host, and OS 9, all have the same issue, I get the OF prompt in the session, but no input.

I've tried direct connection via ethernet, and routing via my router, but no dice????????
You set that whole bunch of text as a nvramrc script. The returns can be replaced with spaces. I guess you would enter it with this code:
Code: [Select]
nvedit
: tnio " enet:telnet,10.1.2.3" io ; : rbn " mac-boot" " boot-command" $setenv reset-all ; : rbt " tnio" " boot-command" $setenv reset-all ;
nvstore
setenv use-nvramrc? true
I never really used nvedit, so I just took the code you put in your example and modified it. I have no idea if that is the correct way to do it.

Here is the theory of operation of that nvram script:
When it is run, it creates 3 forth words with the names of tnio, rbn, and rbt. This is way before of is ready to boot. If the enviroment variable boot-command is set to tnio, tnio will be run when the machine tries to start up. It will set itself up so it can recieve incoming telnet connections and just wait for you to connect to it. Once you have a open telnet prompt, you can do whatever you like. Type mac-boot to make the system boot normally.

If you type rbn, boot-command will be set back to mac-boot. This is useful when you are done testing and don't want the machine to wait for you to connect over telnet.

If you type rbt, boot-command will be set to tnio. This sets up telnet booting, which is really useful.

Both rbn and rbt restart the machine after they write to nvram.

I have no clue how to troubleshoot your QS telnet problem. No, I have not had any problem like it.