Building Gulam

All about the serious stuff.

Moderators: Mug UK, Zorro 2, Moderator Team

Post Reply
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2841
Joined: Sun Jul 31, 2011 1:11 pm

Building Gulam

Post by Eero Tamminen »

Gulam implements a scriptable shell, large set of Unix shell commands and a small MicroEmacs version, all in a single 100KB binary.

However, it has few bugs. Sources for it are in ggn's archive: https://github.com/ggnkua/Atari_ST_Sour ... ratt/GULAM

According to Thorsten, building it needs either Mark Williams-C, or Megamax-C, but he mentions here having an untested version converted to Pure-C: viewtopic.php?t=39474

Has anybody link to those sources and/or tested it?
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2372
Joined: Sun Aug 03, 2014 5:54 pm

Re: Building Gulam

Post by ThorstenOtto »

Still haven't tested it much, but source is here:
You do not have the required permissions to view the files attached to this post.
User avatar
shoggoth
Nature
Nature
Posts: 1222
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: Building Gulam

Post by shoggoth »

Wow. Interesting stuff, this makes a lot more sense as a standard shell on the Atari compared to e g Bash.
Ain't no space like PeP-space.
mikro
Hardware Guru
Hardware Guru
Posts: 3005
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: Building Gulam

Post by mikro »

Interesting, indeed; it would seem that Alan Pratt from Atari Corp. at some point decided to adopt it for internal Atari use and developed it further.

Thorsten, it seems that you've made quite a lot of changes there, you did not keep a git log by any chance? :)
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2372
Joined: Sun Aug 03, 2014 5:54 pm

Re: Building Gulam

Post by ThorstenOtto »

Of course i did. Now at https://github.com/th-otto/gulam
simonsunnyboy
Moderator
Moderator
Posts: 5520
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Building Gulam

Post by simonsunnyboy »

It had a hardcoded keyboard map IIRC.
I'd love to see a version which just uses what TOS has configured.
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2372
Joined: Sun Aug 03, 2014 5:54 pm

Re: Building Gulam

Post by ThorstenOtto »

Yes, that was nonsense. It installed a hardcoded US keymap when invoking ue, so you had different keyboard mappings in the shell and in the editor (unless you happen to have a TOS with builtin us keymap). Dunno why they did that.
trevorbl
Atariator
Atariator
Posts: 27
Joined: Fri Sep 17, 2021 10:05 am

Re: Building Gulam

Post by trevorbl »

Coincidently, I recently worked on gulam with gcc.
Fixed a couple of bugs with shell scripting, and used TOS configuration for the key map.
I'll put it up on sourceforge within the next week.
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2841
Joined: Sun Jul 31, 2011 1:11 pm

Re: Building Gulam

Post by Eero Tamminen »

trevorbl wrote: Thu Dec 01, 2022 1:33 pm Coincidently, I recently worked on gulam with gcc.
You fixed it enough to be able build a fully working version with GCC?
trevorbl wrote: Thu Dec 01, 2022 1:33 pm Fixed a couple of bugs with shell scripting, and used TOS configuration for the key map.
I'll put it up on sourceforge within the next week.
What other bugs you fixed besides the annoying key map issue?
trevorbl
Atariator
Atariator
Posts: 27
Joined: Fri Sep 17, 2021 10:05 am

Re: Building Gulam

Post by trevorbl »

I have now reproduced my gulam work on sourceforge:
https://sourceforge.net/p/gulam-atari-l ... HEAD/tree/

The keymap fix is in revision3

Other fixes:
  • touch command behaved opposite to unix when the file did not exist. added -c option to make it compatible
  • ! expr was interpreted as history expansion, so shell scripts were messed up
  • +/- in shell expr was interpreted as option switch
There is also a little bit of code tinkering in there - things like ansify functions, make them static or void where able to.

Re gcc, most of the work was already there (done by bammi, I think), it just needed to be hooked in.

I got this from github, here -> ggnkua/Atari_ST_Sources
It included some original code, then the work done by Alan Pratt. That's rev 1 & 2 in the source repository

Rev 3 is the keyboard fix. Tested only on UK keyboard.

Quick start for git users:
svn log ## get the log
svn diff -c 3 ## diff for revision 3

or use a gui like tortisesvn or kdesvn, or whatever.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2372
Joined: Sun Aug 03, 2014 5:54 pm

Re: Building Gulam

Post by ThorstenOtto »

trevorbl wrote: Fri Dec 02, 2022 11:01 pm Quick start for git users:
svn log ## get the log
svn diff -c 3 ## diff for revision 3

or use a gui like tortisesvn or kdesvn, or whatever.
or use

Code: Select all

git svn clone  https://svn.code.sf.net/p/gulam-atari-linux-type-shell/code/ gulam
;)
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2372
Joined: Sun Aug 03, 2014 5:54 pm

Re: Building Gulam

Post by ThorstenOtto »

BTW, which gcc version are you using? i was not able to compile your version. Amongst others, it complained about a missing <linea.h>.

OTOH my version on https://github.com/th-otto/gulam compiles cleanly with recent gccs. but i did also much more cleanups with respect to prototypes (which also means it won't compile anymore with MWC, but who cares ;)

I'm currently looking at the other changes you did.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2372
Joined: Sun Aug 03, 2014 5:54 pm

Re: Building Gulam

Post by ThorstenOtto »

BTW, disabling the XMDM (xmodem and terminal emulation) feature now drops the binary size to ~70K compiled by Pure-C. Even the gcc compiled version is now less than 100k (including some string functions from mintlib).
stormy
Atari God
Atari God
Posts: 1363
Joined: Tue Jan 26, 2016 12:39 pm

Re: Building Gulam

Post by stormy »

I am a little confused since it includes 60+ built-in commands, does that mean it is not supposed to be used in a Mint-unix environment, would the in-built commands conflict with the systems installed commands? Or is this something that is meant to be used in TOS, not in a unix-like-os.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2372
Joined: Sun Aug 03, 2014 5:54 pm

Re: Building Gulam

Post by ThorstenOtto »

The builtin commands do not use mint functions (its from '86 after all). Also it switches into full-screen mode, so probably does not work very well when you try to run it eg.in toswin or Magic's VT52.

But other than that, it should work on these systems (eg. when run from mint.cnf as init= command). It just does not support long filenames etc.

As for the builtin commands, they are preferred over external commands when there are conflicts. But you can always alias them, eg. by using

Code: Select all

alias ls C:\usr\bin\ls
Also be aware that the script language is more csh-like than sh-like, eg. you have to use setenv instead of using something like "PATH="
trevorbl
Atariator
Atariator
Posts: 27
Joined: Fri Sep 17, 2021 10:05 am

Re: Building Gulam

Post by trevorbl »

ThorstenOtto wrote: Sat Dec 03, 2022 9:48 am BTW, which gcc version are you using? i was not able to compile your version. Amongst others, it complained about a missing <linea.h>.

I'm currently looking at the other changes you did.
I use gcc 1.40. This is a very old version, but it fits onto a floppy disk, so I can work assuming I have a single floppy STE, as per original Atari spec.
It is probably the version that was current about the time the original work was done on Gulam.

There are lots of compiler warnings, so there's lots of work to clean up the code.
I did a little bit of cleaning up, but only fixed the things that I needed, and left it there.

Please do look at my changes. It's easy to make mistakes, so any comment you have might save me trouble later on.
trevorbl
Atariator
Atariator
Posts: 27
Joined: Fri Sep 17, 2021 10:05 am

Re: Building Gulam

Post by trevorbl »

stormy wrote: Sat Dec 03, 2022 5:37 pm I am a little confused since it includes 60+ built-in commands, does that mean it is not supposed to be used in a Mint-unix environment, would the in-built commands conflict with the systems installed commands? Or is this something that is meant to be used in TOS, not in a unix-like-os.
Some of the code contains

Code: Select all

#ifdef __MINT__
constructs.

This doesn't mean it runs under mint, but it might, and was at least considered at the time.
mikro
Hardware Guru
Hardware Guru
Posts: 3005
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: Building Gulam

Post by mikro »

trevorbl wrote: Sat Dec 03, 2022 6:59 pm Some of the code contains

Code: Select all

#ifdef __MINT__
constructs.

This doesn't mean it runs under mint, but it might, and was at least considered at the time.
No, this #define is meant for Atari-specific code. Every gcc with the mint target sets this internally. It's a bit misleading.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2372
Joined: Sun Aug 03, 2014 5:54 pm

Re: Building Gulam

Post by ThorstenOtto »

trevorbl wrote: Sat Dec 03, 2022 6:53 pm I use gcc 1.40. It is probably the version that was current about the time the original work was done on Gulam.
That's altogether possible. However newer versions, and also Pure-C, did not only spit out lots of warnings, but also lots of errors. And most of them are real errors, not only porting problems. For example
functions like backdel are declared with three arguments, but are only called with 2 most of the time. There are lot of such unclean things which might have work with simpler compilers, but certainly won't with gcc or Pure-C.
I did a little bit of cleaning up, but only fixed the things that I needed, and left it there.
All of the things you are currently fixing up, are already done in my repo (and many more). I would recommend you start from that instead of doing it again.
Please do look at my changes. It's easy to make mistakes, so any comment you have might save me trouble later on.
I have integrated most of your real changes already, like the fix for the touch command (and also a fix for the fix ;). If you want to develop gulam further, i would happily give you write access to the repo.
User avatar
shoggoth
Nature
Nature
Posts: 1222
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: Building Gulam

Post by shoggoth »

@ThorstenOtto: What's the goal here; a cleaned up Gulam with all the nasty stuff removed, or a compilable Gulam?
Ain't no space like PeP-space.
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2841
Joined: Sun Jul 31, 2011 1:11 pm

Re: Building Gulam

Post by Eero Tamminen »

ThorstenOtto wrote: Sat Dec 03, 2022 1:00 pm BTW, disabling the XMDM (xmodem and terminal emulation) feature now drops the binary size to ~70K compiled by Pure-C. Even the gcc compiled version is now less than 100k (including some string functions from mintlib).
What it was before i.e. how much of the binary xmodem + related terminal emulation used?

(Nowadays one would definitely use faster external binaries for such transfers, and for terminal functionality, so dropping them sounds fine.)
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2841
Joined: Sun Jul 31, 2011 1:11 pm

Re: Building Gulam

Post by Eero Tamminen »

shoggoth wrote: Wed Dec 07, 2022 7:14 pm @ThorstenOtto: What's the goal here; a cleaned up Gulam with all the nasty stuff removed, or a compilable Gulam?
Well, latter is a first step for the other item...
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2372
Joined: Sun Aug 03, 2014 5:54 pm

Re: Building Gulam

Post by ThorstenOtto »

shoggoth wrote: Wed Dec 07, 2022 7:14 pm @ThorstenOtto: What's the goal here; a cleaned up Gulam with all the nasty stuff removed, or a compilable Gulam?
Both. But that goal is already achieved. It's compilable (and works) by both Pure-C and gcc. But since i usually use the builtin mupfel from gemini, i don't have much need for it, and don't plan to develop it much further. So if somebody else wants to do that, please go ahead.
Eero Tamminen wrote: What it was before i.e. how much of the binary xmodem + related terminal emulation used?
For Pure-C: ~75K with the XMDM feature, ~70K without.
For gcc: ~104K with the XMDM feature, ~97K without (compiled with -O2, using -Os gives much smaller binaries)
Post Reply

Return to “Applications”