Hacker News new | past | comments | ask | show | jobs | submit login
Lotus 1-2-3 For Linux (cmpxchg8b.com)
703 points by taviso on May 21, 2022 | hide | past | favorite | 83 comments



> It turns out that the BBS also had a warez copy of Lotus 1-2-3 for UNIX. This was widely thought to be lost – I’m told it couldn’t compete with a more popular UNIX office suite called SCO Professional, so there were not many copies sold.

I wonder if anyone still has a copy of Lotus 1-2-3/M? It was the port to the IBM mainframe operating systems MVS (nowadays known as z/OS) and VM/CMS (nowadays z/VM). [0] Not that I ever used it or saw it, but just I have become fascinated with it from reading descriptions of it. From what I understand, it is more different from 1-2-3 for DOS than the Unix or VMS ports were; the Unix and VMS ports work with character mode terminals (such as VT100 compatibles), which while rather different from the terminal model used on MS-DOS or text mode OS/2 (direct memory access to the screen buffer), nonetheless are close enough that the bridge can be gapped–which (on Unix) is classically the job of the curses library (and its various descendants). By contrast, 1-2-3/M was written to work with the block mode 3270 terminals commonly used on IBM mainframes, which send to/from the terminal whole screenfuls of data at a time, rather than individual characters (somewhat similar, in principle, to classic HTML forms). This forced greater changes in the UI compared to the other ports, because a lot of things which are easy to implement with character mode terminals are essentially impossible in 3270.

[0] https://www.ibm.com/common/ssi/ShowDoc.wss?docURL=/common/ss...


> which send to/from the terminal whole screenfuls of data at a time, rather than individual characters

3270, and it's derivatives such as 6530, had (have?) a protect mode protocol that sends fields in much the same way as an HTTP post [1]. It doesn't seem to have been used that much on IBM's, probably due to the synchronous write-a-screen-and-wait-for-the-result readline style of programming. However, it was used extensively on the Tandem, which had an asynchronous 3-tier style architecture.

1. https://x3270.miraheze.org/wiki/3270_data_stream_protocol


Saying "whole screenfuls of data at a time" was me simplifying things for the benefit of the uninitiated. In terms of what actually happens (from what I understand), the 3270 controller sends the host an interrupt to say some terminal has data ready. When the host gets around to it – on a busy mainframe system with thousands of terminals, the interrupt would be queued while the host had finished processing data from other terminals – the host would send the controller either a READ BUFFER command (which would send the host the entire contents of the screen) or a READ MODIFIED command (which would only send the modified fields). Most 3270 apps would define fields on the screen using START FIELD (SF) special characters, which is essentially what you mean by "protect mode protocol" (3270E added START FIELD EXTENDED, SFE, which allowed you to do fancier things like change the text colour, or define a field as numeric only, so the terminal would not allow alphabetic characters to be input into it), and then read only the modified fields back using READ MODIFIED. I believe READ BUFFER was mainly used for legacy applications which were written prior to the invention of READ MODIFIED (in particular applications originally written for the 3270's 1960s predecessor, the IBM 2260, which didn't have any such concept.)


A childhood memory from when I was little:

We were at Sears, and my parents were waiting for customer service-- they were buying an appliance or something. There were terminals around, open to public use. I recognized them as 3290's from my dad's work.

They had an application where you could do form work-- building up an order or searching for stock on items-- that used this protect mode. You'd fill in fields and then hit a pfkey, and wait several seconds for a result.

I can't find anything about this system having ever existed online-- one of those blackholes of missing information about pre-web days. There's an interesting web site of how point-of-sale evolved at Sears and other places-- https://vintagepointofsale.com/author/jpnearl/ but that's not really what I'm talking about.

I remember other instances of this from when I was little, too. Lots of IBMs internal applications used this whole forms interface and the lower right status HOLDING while you filled out fields. And I recall travel agents using it with SABRE, too.

My memory is that it wasn't uncommon-- that a whole lot of mainframe usage looked like this: https://basis.uark.edu/frequently_asked_questions/email_noti...


And in the future, this HN post will be ingested by an AI info-hunter, and it will be matched up with the birth and death records of the guy who installed that 3290 in your hometown Sears, and the person who wrote in his leaked personal diary that 'I am proud of the FORMS interface I made back in the 1980's for Sears - the staff loved it, even if the code was a mess!".

By collecting all that data, the AI info-hunter will in milliseconds be able to tell a young girl 150 years from now that "Your great great grandfather was a computer man. I found 168,235 deceased people who directly used his work, and while his work never made it to the internet, there is a high probability that it is recoverable from a trash dump site in California in a red safe buried 13 yards below the surface also containing some car keys and a vintage $50 note. Shall I navigate there now?".


Damn it, that logic Joe went on the fritz again! I don't know whether to fix him or take a hatchet to him, but until I figure that out I'm gonna unhook him and keep him locked in my basement, just to make sure he don't cause no more trouble...


around 2001 or 2002 JCPenney got rid of their 80s era mainframes, and i got an IBM mainframe, and i can't remember if it was as/400 or rs6000, but it was two racks, with a hard drive the size of a small clothes dryer (and louder), and a 9" floppy. The IBM stuff didn't sell on ebay that well, but the cisco stuff (the second rack?) sold alright. Mostly went to repairing my junker car back then.


AS/400 and RS/6000 are not (per official IBM terminology) “mainframes”. AS/400s were classified as “midrange” systems.

From the floppy, I’m guessing it was more likely to be an AS/400. (RS/6000s had them too, and they were originally invented on mainframes, where they were used for microcode updates-but I believe AS/400s dropped them later than RS/6000s and mainframes did.)

Now the RS/6000 and AS/400 lines have been merged at the hardware level - but an old machine being thrown out in 2001/2002 would have been from when they were still distinct hardware.


9" floppy... probably not, I'm betting hypothetical money that it had a 8" floppy.


to both you and sibling: If i had managed to get it to turn on enough to use it for anything, i'd remember a lot more about it. It was just scrap by the time i got it. we really wanted the racks.


> had (have?)

I was at my insurance agent a few weeks ago and they still had a 3270 emulator in use.


Many insurance companies are stuck with core legacy on AS/400 (at best).


If accessing an AS/400 then likely it would be a 5250 emulator rather than a 3270.


AS/400s actually support 3270 terminals. Apps natively speak 5250, but OS/400 has a built-in 3270/5250 conversion layer. IBM wanted to sell AS/400s to their mainframe customers who had already invested heavily in 3270, insisting people had two terminals on each desk (3270 and 5250) was a non-starter, hence the emulation layer.

Makes less sense now just about everyone uses emulators rather than physical terminals, especially when you can get emulators which speak both - but still supported anyway. You can set up your IBM i to accept TN3270 as well as TN5250.

That said, people confusing 5250 for 3270 is more common than people actually using 3270 with an AS/400, so this is probably a case of the former rather than the later


State Farm?


Yes


> This forced greater changes in the UI compared to the other ports, because a lot of things which are easy to implement with character mode terminals are essentially impossible in 3270.

Couldn't they just render everything to a local virtual terminal and then send the screen after updates?


One big problem – on a character mode terminal such as a VT100, the host gets sent every single keystroke. So any key combination can be used as an "action key" – such as the slash key (/) used to open the Lotus 1-2-3 menu system. By contrast, on block mode terminals such as 3270, only a restricted subset of keys – such as ENTER and function keys – triggered a message being sent to the host, the rest of the keys were interpreted locally only. (Was there some mechanism to allow the host to redefine an arbitrary key as an action key? Not that I know of.)

How did Lotus 1-2-3/M address this? From what I understand, they adopted an approach commonly used in 3270 applications – a fixed area at the bottom of the screen was reserved as a "Command area". You would type your slash sequence there, and then press ENTER. The whole sequence would be sent to the host. If what you typed was not a full command, just the prefix of a command, I believe it would display you a menu showing the command options, similar to how 1-2-3 worked on other platforms.

But it also was a problem with things like scrolling off the screen. On 1-2-3 on other platforms, you could just use the cursor keys, and the screen would scroll immediately. Under 3270, the cursor keys are implemented locally, so you'd have to use a function key or command to scroll instead.


The speeds to terminals were not great, and this is completely in contrast to how the terminals were meant to be used.

The big idea behind the 3270 architecture was to support things like CICS, where you could have tens of thousands of terminals attached to a single processor computer with 16 megabytes of memory, and then take individual requests from terminals, recover state, and render screens.


SAS has a mainframe spreadsheet module.


That was awesome, but they skipped over the crucial part I'm most interested in: how the heck did they rewrite and reroute the incompatible system calls and libc functions? That's probably the hardest task of it all.

How would you go about it in the first place?

EDIT: ah, their coffsyrup tool (https://github.com/taviso/123elf/blob/main/coffsyrup.c) with help from objdump (it's more powerful that I gave it credit for) does the relocation and patching. I would have loved to read more into that part of the process.


Outside of patching, it's not that hard, it's just structure conversion at that point.

The coff tool is harder than the rewritten functions.


But where does that structure conversion code go? Into a support dynamically linked library?


Most likely, you compile the support functions into another .o, and statically link it with the modified 123.o.


Fascinating write up!

Curious how piracy seems half the time to be the best form of archival for older software that was abandoned (most older software is no longer available to download even if one has a license, let alone still runs on a more modern environment, but if you have A you can try and sort out B, as this post so nicely demonstrates)


It seems like sheer luck that a 30-year-old tape archive was readable. What format is a BBS operator from the early 90s likely to have used? QIC? DAT?


No idea regarding format, but tape is famously quite hardy if stored well from what I've been led to understand. Not to mention datahoarders are way more common than one thinks, so I wouldn't be surprised if there are some decent number of old treasure troves out there just waiting to be recovered.


We've got a few stacks of PDP-11 tape packs at work, and someday I'd like to see what's on them. I've figured my best bet is probably to learn how to fix the original hardware enough to get it functioning, then connect the tape drive to a modern computer somehow to image the tapes. I haven't pursued it further because I'm sure it's all cash register records from the 80s if they're even still intact.


Tavis Ormandy has had everything ranging from ice cold takes to white hot takes, but man, when he does something cool, it's usually the coolest thing I've heard of in months and months.

Love seeing his step-by-step on hacking something like this together. What a great engineer.


Overall very interesting article, but this bit caught my eye:

Linux did have lcall7 and lcall27 compatability support

There is very little information available online about that --- section 2.11 here might be a better description:

https://tldp.org/LDP/lki/lki-2.html

Further digging reveals that it's related to https://en.wikipedia.org/wiki/Intel_Binary_Compatibility_Sta... (which I couldn't find the actual document of) and might explain where the original set of system call numbers in Linux came from. This also reminds me of the "CALL 5" interface in DOS which was used for CP/M compatibility.


Little known fun-fact re Lotus 1-2-3 was that it came on a ROM cartridge for the PCJr. The PCJr was a total sad sack of a machine. Technically superior to the PC and cheaper too so IBM intentionally crippled it with incompatibility bugs so that businesses could not really rely on it.

BUT they did release Lotus 1-2-3 for it in on a ROM cartridge which in the days when most programs ran on 5.25 inch floppies meant that performance just cranked!


Old boss had a handheld computer which ran 1-2-3 from ROM. Spreadsheets on the fly!

I think this was it: https://en.wikipedia.org/wiki/HP_95LX


I had something similar to that, a long time ago -- HP_100LX. Having Lotus 1-2-3 in ROM was a really big deal back then.


>Technically superior to the PC

Really? I remember it having a "chiclet" keyboard that was widely criticized among other things. As for the compatibility, I'm not sure how many computer makers at that time--including IBM--completely grokked that PC compatibility really did mean 100% compatibility as opposed to mostly compatible.


The keyboard was awful but it was more graphically and audibly better than the IBM PC. The "Tandy" graphics mode in old PC games is really PC Jr. graphics mode as Tandy cloned it. Processing powerwise a 286 AT from the same time frame would have been better.

For the home market where the Jr. was aimed it really needed the better graphics and sound to compete with the C64 and the like.


Well, it was newer and aimed at the home market--and IBM didn't worry too much about compatibility for whatever reasons (good or bad). PC compatibles didn't have decent standard graphics until EGA came along (though many systems would support Hercules for monochrome graphics).

But to your basic point. Yeah. IBM wanted to create a competitor to the other home computers. Not cannibalizing its business computers was probably a rather secondary concern.


It's what you get when you have a bunch of business suits go and create a computer to be used for entertainment.

I'm sure the PCjr could have really taken off if it had been more like the Amiga.


I'm not sure.

The PCjr had the promise of "runs some PC software", so if Dad needs to finish his spreadsheet from the office in an emergency, he can barge the kids off the PCjr for the night.

If it had been something different to the point of total incompatibility, why not buy the kids a cheaper Atari 800XL or C64 for games and "educational software" instead?

You can also argue that the PCjr's unique features did survive a bit longer, in the form of the Tandy 1000 series.


Boca was sort of a skunkworks operation so I'm not sure it's fair to describe it as a bunch of business suits. But certainly in general, IBM had no real experience with the consumer market so it's not really clear to me what they were looking to accomplish with the PCjr. (Though I admit I'm not really familiar with its history.)


Refreshing my memory via Wikipedia the PCjr and AT did come out about the same time but the AT cost 6k in 1984 vs 1500 for the Jr. 6k in 1984 was around 12-13k in 2022 dollars.


That was the first gen keyboard quickly replaced by a nice model which was perfectly comfortable and quote ahead of its time wireless (IR).


I am aware of a very large company that still uses Lotus 123 for hundreds of millions of dollars of business.


You might be surprised how efficient in practice it can be. Often, new software can be a net negative on productivity.

Emacs is the most productive environment (for me) and it is half a century old.


I have used Lotus 1-2-3 for about 5 years, until switching to Windows 95, where the GUI version of 1-2-3 no longer had significant advantages over MS Excel.

There is no doubt that for any tasks simple enough to have their speed limited by the interaction with the user, and not by waiting for a very large number of cells to be recomputed or by the execution time of a long macro, the MS-DOS Lotus 1-2-3 on an 80386 CPU was faster than MS Excel or any other modern spreadsheet program on a modern computer with a CPU having a one hundred times higher clock frequency.

Lotus 1-2-3 had a well-designed menu-driven user interface and the keyboard shortcuts needed to execute quickly all menu commands became automatic in a short time for anyone who used the program daily, and they were easy to discover for novice users.

In the recent versions of MS Office, the menu structure has become very opaque for me, even if I have used it for decades, since its first version. I may need some minutes to discover in which submenu a seldom-used command can be found, because the distribution of the commands over the menu hierarchy no longer makes sense for me, even if I know that the command must exist, because I had used it in some older version of MS Office, where it was located in a completely different submenu.


> where the GUI version of 1-2-3 no longer had significant advantages over MS Excel.

There was a preference that for some reason was off by default that enabled / commands, so that you could use the GUI version just like the old DOS version. My dad did that for years when his company forced him to switch to GUI 1-2-3, until they finally forced him to switch to Excel.


But unlike 1-2-3, Emacs is still being developed.


When Yegge was at Amazon he set up a bunch of office admin systems in Emacs.

Office admin staff hated the web based alternatives when they were rolled out

(According to Yegge.)


Is it a TUI version of 1-2-3?


No it's the GUI version. Last updated in 2002.


Is it IBM? :)


Ha! No, but it was sold by IBM.


My first PC came with LotusSmartsuite on CD-ROM. At the time I dreamed that the office suite area was full of competition and vendors would implement features all the time continuously improving their offers. It probably was actually like that at the time (1997). Soon monopoly turned on.

We are seeing a new resurgence now. There is some competition. Even on the FLOSS space, LibreOffice must show it is better than OnlyOffice. But it is very far from how things looked like in mid 90's when office suite vendor really had to include useful and differentiated software.


Yeah I had Lotus SmartSuite - I remember it had quite nice skeuomorphic design in a lot of areas.

You're probably right about the competition, Wordperfect was the market leader at one point, and Adobe also had FrameMaker - perhaps more of a Publisher competitor.


My first "real" job was working at Arthur Anderson, where due to my geeky love of computers I was able to quickly move from the mail room to Data Processing.

1-2-3 was like crack for accountants (it was first released right around that time). One of my tasks was making "backup copies" for users. Probably had 1 legit copy for every 20 staffers so this was quite a sum of money they "saved".

After getting sued for millions for copyright infringement they realized it was cheaper to buy a real copy for every user.


Leave it to Arthur Anderson to try to do creative accounting of software licenses!


Andersen, to be correct.


mea culpa. It's been almost 40 years and I was lazy with proofing.


Great write up.

Travis is moving on from 0 (Google Project Zero) to 1-2-3.

I wonder when the article about Quattro Pro will come.



So, incidentally, having symbols makes it doable to use a decompiler to retrieve something resembling source code.

Just putting that thought out there.


If you have symbols and know the language (even better the exact version of the compiler) you can get almost the original source files “minus comments”.


https://simson.net/clips/1990/1990.Computerworld.GNU-Softwar...

This 1990 Computerworld article mentions that Lotus compiled all their Unix applications with gcc. Given the timeframe involved, this likely means early gcc 1.x and supporting tools


That would be a worthwhile project.


Anyone else misread the title as "Lotus Notes for Linux" and break out in cold sweats of fear and PTSD? XD


I used to fill photocopiers for a living at IBM North Harbour in Portsmouth back in the very early 00's, and I could never get my head around Notes. The first and only place I ever saw it in the wild.


My employer moved from Notes to Outlook and CA Service Desk Manager software not long before I was hired (2012). Some of the more senior employees miss Notes for it's service desk features.


Inspirational! And “coffsyrup” made me giggle. Thank you Tavis!


There is one thing I feel like missing now: dosbox should have a mode to run DOS programs on the terminal and only start a GUI if a graphics mode is started. That would give seamless use of DOS apps.


dosemu can do this with the -t option, I have used this to run the Turbo Pascal UI on a terminal, works great. Have to make sure that the terminal width is exactly 80 columns.


There was WordPerfect for unix back in the day as well, I used it at work in an HP-UX environment. I don't know if it was ever available for Linux.


There is a free version of WordPerfect for Linux.

https://liam-on-linux.livejournal.com/80768.html


I am wondering what other interesting software existed from around that era that was shipped with Corel Linux.


I recall there was a port of the Wingz spreadsheet to Linux in the mid-to-late nineties. Not shipped with Corel Linux, though.


Kinda cool they were able to find that object file.


I fixed some spelling mistakes: https://github.com/taviso/123elf/pull/1


He named the website after the compare and exchange instruction ???. My intel assembler is rather rusty.


It is explained in the FAQ:

There was a bug in early Pentiums called the f00f bug, it would cause a deadlock if you provided an invalid operand to cmpxchg8b while using the lock prefix. It was an important vulnerability at the time, and I thought it would be fun to own lock.cmpxchg8b.com.


Tavis, what a legend! This is awesome.


wasn't there a java lotus suite later developed that died off very quickly? I recall running it on Solaris



That is indeed the one. From recollection it used an incredibly amount of system resources


I love reading stuff like this.


this is absolutely amazing. thank you!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: