Building Gulam
Moderators: Mug UK, Zorro 2, Moderator Team
- Eero Tamminen
- Fuji Shaped Bastard
- Posts: 2841
- Joined: Sun Jul 31, 2011 1:11 pm
Building Gulam
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?
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?
-
- Fuji Shaped Bastard
- Posts: 2372
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Building Gulam
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.
Re: Building Gulam
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.
-
- Hardware Guru
- Posts: 3005
- Joined: Sat Sep 10, 2005 11:11 am
- Location: Kosice, Slovakia
- Contact:
Re: Building Gulam
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? :)
Thorsten, it seems that you've made quite a lot of changes there, you did not keep a git log by any chance? :)
-
- Fuji Shaped Bastard
- Posts: 2372
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Building Gulam
Of course i did. Now at https://github.com/th-otto/gulam
-
- Moderator
- Posts: 5520
- Joined: Wed Oct 23, 2002 4:36 pm
- Location: Friedrichshafen, Germany
- Contact:
Re: Building Gulam
It had a hardcoded keyboard map IIRC.
I'd love to see a version which just uses what TOS has configured.
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
Stay cool, stay Atari!
1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
-
- Fuji Shaped Bastard
- Posts: 2372
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Building Gulam
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.
Re: Building Gulam
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.
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.
- Eero Tamminen
- Fuji Shaped Bastard
- Posts: 2841
- Joined: Sun Jul 31, 2011 1:11 pm
Re: Building Gulam
You fixed it enough to be able build a fully working version with GCC?
What other bugs you fixed besides the annoying key map issue?
Re: Building Gulam
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:
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.
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
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.
-
- Fuji Shaped Bastard
- Posts: 2372
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Building Gulam
or use
Code: Select all
git svn clone https://svn.code.sf.net/p/gulam-atari-linux-type-shell/code/ gulam

-
- Fuji Shaped Bastard
- Posts: 2372
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Building Gulam
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.
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.
-
- Fuji Shaped Bastard
- Posts: 2372
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Building Gulam
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).
Re: Building Gulam
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.
-
- Fuji Shaped Bastard
- Posts: 2372
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Building Gulam
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
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="
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
Re: Building Gulam
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.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.
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.
Re: Building Gulam
Some of the code containsstormy 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.
Code: Select all
#ifdef __MINT__
This doesn't mean it runs under mint, but it might, and was at least considered at the time.
-
- Hardware Guru
- Posts: 3005
- Joined: Sat Sep 10, 2005 11:11 am
- Location: Kosice, Slovakia
- Contact:
Re: Building Gulam
No, this #define is meant for Atari-specific code. Every gcc with the mint target sets this internally. It's a bit misleading.trevorbl wrote: ↑Sat Dec 03, 2022 6:59 pm Some of the code containsconstructs.Code: Select all
#ifdef __MINT__
This doesn't mean it runs under mint, but it might, and was at least considered at the time.
-
- Fuji Shaped Bastard
- Posts: 2372
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Building 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.
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.I did a little bit of cleaning up, but only fixed the things that I needed, and left it there.
I have integrated most of your real changes already, like the fix for the touch command (and also a fix for the fixPlease do look at my changes. It's easy to make mistakes, so any comment you have might save me trouble later on.

Re: Building Gulam
@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.
- Eero Tamminen
- Fuji Shaped Bastard
- Posts: 2841
- Joined: Sun Jul 31, 2011 1:11 pm
Re: Building Gulam
What it was before i.e. how much of the binary xmodem + related terminal emulation used?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).
(Nowadays one would definitely use faster external binaries for such transfers, and for terminal functionality, so dropping them sounds fine.)
- Eero Tamminen
- Fuji Shaped Bastard
- Posts: 2841
- Joined: Sun Jul 31, 2011 1:11 pm
-
- Fuji Shaped Bastard
- Posts: 2372
- Joined: Sun Aug 03, 2014 5:54 pm
Re: Building 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.
For Pure-C: ~75K with the XMDM feature, ~70K without.Eero Tamminen wrote: What it was before i.e. how much of the binary xmodem + related terminal emulation used?
For gcc: ~104K with the XMDM feature, ~97K without (compiled with -O2, using -Os gives much smaller binaries)