Recent

Author Topic: [SOLVED] Linux, GetUsername( I can't get it!  (Read 1843 times)

lucamar

  • Hero Member
  • *****
  • Posts: 3024
Re: [SOLVED] Linux, GetUsername( I can't get it!
« Reply #30 on: July 13, 2020, 05:41:09 pm »
If somebody knows about Amiga HostName, please tell me (PM, mail).

I don't know about more modern implementations but the classic AmigaOS (up to the default OS of the 4000, I think) knows nothing about hostnames (tested on a 1200 and a 2000*). For networked Amigas I guess (and I might be wrong here) that it depends on the particular nettwork soft used.


* And what a trip to the past has been setting up and on again those venerable granpas! :D
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.8/FPC 3.0.4 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

winni

  • Hero Member
  • *****
  • Posts: 1795
Re: [SOLVED] Linux, GetUsername( I can't get it!
« Reply #31 on: July 13, 2020, 06:55:18 pm »
Hi!

Just looked through the  Amiga command reference and have not found anything about a hostname.

With the network I go with lucamar:

Amiga had by default no network interface and so every vendor build his own stuff.

Winni

PS https://wiki.amigaos.net/wiki/AmigaOS_Manual:_AmigaDOS_Command_Reference
« Last Edit: July 13, 2020, 07:03:13 pm by winni »

QEnnay

  • New Member
  • *
  • Posts: 48
Re: [SOLVED] Linux, GetUsername( I can't get it!
« Reply #32 on: July 13, 2020, 09:29:01 pm »
* And what a trip to the past has been setting up and on again those venerable granpas! :D

You young whipper snappers: When I started programming there was no Borland and no Turbo anything. Tandy Model I with 4K of memory and cassette recorder for 300-BAUD data. Livin' the fast life.
Laz 2.0.8
Linux-Mint 20.04.0 + Cinnamon, Kernel 5.8 (NOT stock Ubuntu/Mint 5.4 Kernel)
Lenovo Flex 5 Ryzen 5 4500, 512GB-NVMe, 16GB memory

lucamar

  • Hero Member
  • *****
  • Posts: 3024
Re: [SOLVED] Linux, GetUsername( I can't get it!
« Reply #33 on: July 13, 2020, 09:54:47 pm »
* And what a trip to the past has been setting up and on again those venerable granpas! :D

You young whipper snappers: When I started programming there was no Borland and no Turbo anything. Tandy Model I with 4K of memory and cassette recorder for 300-BAUD data. Livin' the fast life.

I started in the early 1980s with a Sinclair Spectrum 48k, a B/W TV set we "forgot" to trash, and reading/writing tapes with my father's Hi-Fi tower. Fun and excitement all around! Except the full summer I had to work to get money for the thing, of course ;)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.8/FPC 3.0.4 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 941
  • Former Delphi 1-7, 10.2 User
Re: [SOLVED] Linux, GetUsername( I can't get it!
« Reply #34 on: July 14, 2020, 02:20:14 am »
I started in the early 1980s with a Sinclair Spectrum 48k, a B/W TV set we "forgot" to trash, and reading/writing tapes with my father's Hi-Fi tower.

Commodore VIC-20 with 3.5 KB of RAM, cassette recorder and 12" B&W TV -- I had to build my own RS232 interface to connect my dumb (ie non-HAYES) 300 baud modem. Later I built a  3 KB RAM expander with point to point wiring for the six static RAM chips using telephone wire on Vero board which took me two days of soldering). Those were the days ;)
o Lazarus v2.1.0 r63871, FPC v3.3.1 r46876, macOS 10.14.6 (with sup update), Xcode 11.3.1
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.1 amd64 (VMware Fusion VM)
o FPC 3.0.4, FreeBSD 12.2-STABLE r365646 amd64
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 18.04 (Parallels VM)

TRon

  • Hero Member
  • *****
  • Posts: 536
Re: [SOLVED] Linux, GetUsername( I can't get it!
« Reply #35 on: July 14, 2020, 04:41:50 am »
I applied the function GetCurrentChangeLog change in r63554. I guess the GetHostName stuff was little out of topic in this GetUserName thread.
If somebody knows about Amiga HostName, please tell me (PM, mail).
As already mentioned by others, Amiga did not had hardware to connect to a network by default.

As such the implementation of the network stack depended on the hardware vendor, although there were some standard/default stacks available.

AmiTCP, Miami and BSDSocket are just a few names in relation to that subject and which might be able to get you the hostname using an environment variable (when setup correctly) or can be obtained by a library function. MorphOS for instance can make use of yet another stack, while AROS (and Amiga's using AROS kickstart) attempts to provide BSDSocket by default.

The best solution to that imho would be to solve it just as ApplicationName and VendorName do it by providing a custom override for the enduser, such as OnGetApplicationName and OnGetVendorName

That way you are able to provide a default implementation (depending on the platform), but at same time let the implementation details over to the end-user in case end-user environment requires it.

Would that be an option ?

edit, just noticed the first question
Question about Amiga: does it need special treatment? Does it have 'COMPUTERNAME'?
It does when that specific environment variable is set  ;) (e.g., no it does not have that environment variable by default. I am not aware of any software that does supply this particular name).
« Last Edit: July 14, 2020, 09:05:50 am by TRon »

TRon

  • Hero Member
  • *****
  • Posts: 536
Re: [SOLVED] Linux, GetUsername( I can't get it!
« Reply #36 on: July 14, 2020, 08:41:02 am »
Hi winni,

PS https://wiki.amigaos.net/wiki/AmigaOS_Manual:_AmigaDOS_Command_Reference

Be careful with what you refer to, as that page is related to AmigaOS4. There is somewhat of a resemblance but that is about it.

Currently there is officially no support for that platform as there is (again officially) no maintainer. Support is offered for AmigaOS3.x, AROS and MorphOS. The classic AmigaOS1.x and modern AmigaOS4.x targets are officially not supported and should therefore be considered unmaintained. Current maintainers do try to keep things going, but only to a certain level and when time permits.

PascalDragon

  • Hero Member
  • *****
  • Posts: 2131
  • Compiler Developer
Re: [SOLVED] Linux, GetUsername( I can't get it!
« Reply #37 on: July 14, 2020, 09:13:38 am »
Currently there is officially no support for that platform as there is (again officially) no maintainer. Support is offered for AmigaOS3.x, AROS and MorphOS. The classic AmigaOS1.x and modern AmigaOS4.x targets are officially not supported and should therefore be considered unmaintained. Current maintainers do try to keep things going, but only to a certain level and when time permits.

Well, AmigaOS1.x is not yet supported. Charlie is improving the RTL step by step to get it working there as well.

Also we do have an official AmigaOS4.x release. It's just that the target is not getting as much love as the other Amiga-likes and the X5000 is not supported.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3827
  • I like bugs.
Re: [SOLVED] Linux, GetUsername( I can't get it!
« Reply #38 on: July 14, 2020, 09:32:34 am »
The best solution to that imho would be to solve it just as ApplicationName and VendorName do it by providing a custom override for the enduser, such as OnGetApplicationName and OnGetVendorName

That way you are able to provide a default implementation (depending on the platform), but at same time let the implementation details over to the end-user in case end-user environment requires it.

Would that be an option ?
I believe it is a good idea but not in the scope of the Lazarus IDEProcs helper function. It should probably be part of FPC's libs.
The helper function in IDEProcs is used only for a non-critical log info inserted into source editor. The Amiga target may have bigger issues than that.
I have understood that Lazarus really runs on Amiga which I find amazing! I don't know how many people are testing it.
Mostly Lazarus trunk on Manjaro Linux.

TRon

  • Hero Member
  • *****
  • Posts: 536
Re: [SOLVED] Linux, GetUsername( I can't get it!
« Reply #39 on: July 14, 2020, 09:33:34 am »
Well, AmigaOS1.x is not yet supported. Charlie is improving the RTL step by step to get it working there as well.
Yes, I know  ;)

If I recall correctly then this is about what Charlie told me with regards to 1.x: "Currently this is one big hack which requires much improvements".

I interpreted that as a understatement. There are a lot of things missing from those old kickstarts and OS, which makes life a bit miserable in order to get everything on par with the other amiganoid targets. Some things are simply not even possible to realise. On the other hand, the original idea came from wanting to have FPC also be able to bang some bits around for classic hardware. In that it is already a success.

Quote
Also we do have an official AmigaOS4.x release. It's just that the target is not getting as much love as the other Amiga-likes and the X5000 is not supported.
I am aware there is a release. Reason there is not much love is (mostly) that there seems to be no interest from that camp and the hardware you mention is ridiculously expensive. Both Marcus and Charlie expressed not wanting to partake in that, at least last time I spoke them. Neither do I have any interest other then what I already contribute.

But, you probably know that already  ;D

TRon

  • Hero Member
  • *****
  • Posts: 536
Re: [SOLVED] Linux, GetUsername( I can't get it!
« Reply #40 on: July 14, 2020, 09:38:48 am »
I believe it is a good idea but not in the scope of the Lazarus IDEProcs helper function. It should probably be part of FPC's libs.
Ah ok. I was already a bit lost on where to find this function. Yes, I agree that should belong to FPC, not Laz.

Quote
I have understood that Lazarus really runs on Amiga which I find amazing! I don't know how many people are testing it.
I do hope no-one  ;)

At least on classic Lazarus is really too resource-hungry for that (it barely runs on a beefed up Amiga). I was able to barely run it on AROS. It is amazing to see it running on those targets though. But, for those interested: stick to FPC or cross-compilation. Using native MUI/Zune for GUI is preferred.

PascalDragon

  • Hero Member
  • *****
  • Posts: 2131
  • Compiler Developer
Re: [SOLVED] Linux, GetUsername( I can't get it!
« Reply #41 on: July 14, 2020, 09:39:34 am »
But, you probably know that already  ;D

Correct. ;)

 

TinyPortal © 2005-2018