OS for IBM 370 
Author Message
 OS for IBM 370

Hi,

I'm rather new to assembly lang. and I have a college class we are
having to write a very watered down version of an OS for the IBM370
mainframe.  I was wondering if anyone could point me to some good
information on writing the OS or on assembly in general.  The concepts
arn't killing me but Assembly is.

Thanks,

Chris



Tue, 19 Aug 2003 06:51:34 GMT  
 OS for IBM 370

Quote:

>I'm rather new to assembly lang. and I have a college class we are
>having to write a very watered down version of an OS for the IBM370
>mainframe.  I was wondering if anyone could point me to some good
>information on writing the OS or on assembly in general.  The concepts
>arn't killing me but Assembly is.

I would at least have a copy of "IBM/370 Principles of Operation".

It has all the details of the hardware, and a little about operating
system related instructions.  IBM will sell you one for $11.25
plus tax.  UPS ground shipping is included, air shipping extra.

Order GA22-7000-10  (call 1-800-879-2755).

Note that many features have been added since then, as 370/XA,
370/ESA, 390/ESA and Z, but the added features make the newer
books somewhat less readable.  If your goal is really S/370 that
is the one you should have.  That will have all the details on
the hardware instructions.  

S/370 assembler is much easier to learn than many popular processors
today.  The addressing modes are simple, but powerful.
The IBM assemblers have a macro feature much better than newer
processors.   If you are writing your own OS, you may need to
write your own assembler, too.  Much of the assembly language is
related to the operating system.

You might look at the gas (GNU assembler) that now exists for
assembling under Linux/390.  It should be possible to run as a
cross assembler, and generate S/370 code running on another
processor.  Note that its input is very different from the
input to the IBM assemblers, even though the hardware is the
same.  

I hope this helps.  If not, ask more.

-- glen



Tue, 19 Aug 2003 07:57:09 GMT  
 OS for IBM 370

Quote:


>>I'm rather new to assembly lang. and I have a college class we are
>>having to write a very watered down version of an OS for the IBM370
>>mainframe...
>...
>S/370 assembler is much easier to learn than many popular processors
>today.  The addressing modes are simple, but powerful.
>The IBM assemblers have a macro feature much better than newer
>processors.   If you are writing your own OS, you may need to
>write your own assembler, too.  Much of the assembly language is
>related to the operating system.

I agree with your characterisation of S/370 assemblers, except for this:

The IBM assembly *language* is actually unrelated to any particular
operating system.  The assembler as a program does expect a certain
environment -- a real or simulated subset of OS/390, effectively.  That
is sufficient for cross-assembly from one operating system (development
environment) to another (your experimental OS in a test environment).
There are also cross-assemblers that run on non-370 platforms.

There is a dependency on the object file format (and some assembly
language constructs are related to this).  This simply suggests that
your experimental OS might as well adopt that format -- it is pretty
simple, especially in its elementary features.  Alternatively, you
could generate a loadable core-image of your OS on the development
platform.  You'd have to do that for bootstrapping anyway.

Another dependency which some people think is a language issue is the
set of system macros used.  But your experimental OS need not use them;
you could provide it with a *much* simpler set of macros if you wish to
encapsulate certain things in macros.  You might actually want to do
just that, so you can more easily evolve the implementation of your
macros (e.g. those used for simple input and output) as your OS grows up.

Michel.

P.S. Writing your own OS is fun and very instructive.  There is unfortunately
     a certain hurdle to overcome, if only to get trivial I/O to work.  If
     you have the chance to work in a VM environment, there are certain cheats
     you can use: hypervisor instructions (CP diagnose), and you can easily
     switch from a development environment like CMS to your test environment.

     I know; I run and maintain an experimental OS developed that way. We were
     able to wean ourselves from CMS and CP 25 years ago and did all further
     development in our own system.  We used the IBM Assembler H in an OS
     simulation (basically a small number of OS/360-derived SVCs) environment
     until the mid-90s; at that point one of us did write a new assembler,
     primarily for the purpose of experimenting with different features, and
     to see how much an already good product could be improved.  This new
     assembler kept the original object file format (even though we were very
     tempted to remove various historical 24-bit restrictions in that format).

     I'm not familiar with certain S/370 simulation environments like Assist
     or Hercules, but they may have similar development-friendly features.



Wed, 20 Aug 2003 00:25:18 GMT  
 OS for IBM 370
One of the most "fun" lab assignments I ever had was in an OP system course.

The problem was to write a program which read cards from the card reader
and printed them on the printer. The only catch was we had to start with
a bare machine and IPL it from the card reader.

The operator would run our decks on 3rd shift, wait until the lights stopped
flashing and then run stand-alone dump. So we got back a raw dump and
any output that might have been produced on the printer.

I learned alot about how interrupts worked.

Quote:




> >>I'm rather new to assembly lang. and I have a college class we are
> >>having to write a very watered down version of an OS for the IBM370
> >>mainframe...
> >...
> >S/370 assembler is much easier to learn than many popular processors
> >today.  The addressing modes are simple, but powerful.
> >The IBM assemblers have a macro feature much better than newer
> >processors.   If you are writing your own OS, you may need to
> >write your own assembler, too.  Much of the assembly language is
> >related to the operating system.

> I agree with your characterisation of S/370 assemblers, except for this:

> The IBM assembly *language* is actually unrelated to any particular
> operating system.  The assembler as a program does expect a certain
> environment -- a real or simulated subset of OS/390, effectively.  That
> is sufficient for cross-assembly from one operating system (development
> environment) to another (your experimental OS in a test environment).
> There are also cross-assemblers that run on non-370 platforms.

> There is a dependency on the object file format (and some assembly
> language constructs are related to this).  This simply suggests that
> your experimental OS might as well adopt that format -- it is pretty
> simple, especially in its elementary features.  Alternatively, you
> could generate a loadable core-image of your OS on the development
> platform.  You'd have to do that for bootstrapping anyway.

> Another dependency which some people think is a language issue is the
> set of system macros used.  But your experimental OS need not use them;
> you could provide it with a *much* simpler set of macros if you wish to
> encapsulate certain things in macros.  You might actually want to do
> just that, so you can more easily evolve the implementation of your
> macros (e.g. those used for simple input and output) as your OS grows up.

> Michel.

> P.S. Writing your own OS is fun and very instructive.  There is unfortunately
>      a certain hurdle to overcome, if only to get trivial I/O to work.  If
>      you have the chance to work in a VM environment, there are certain cheats
>      you can use: hypervisor instructions (CP diagnose), and you can easily
>      switch from a development environment like CMS to your test environment.

>      I know; I run and maintain an experimental OS developed that way. We were
>      able to wean ourselves from CMS and CP 25 years ago and did all further
>      development in our own system.  We used the IBM Assembler H in an OS
>      simulation (basically a small number of OS/360-derived SVCs) environment
>      until the mid-90s; at that point one of us did write a new assembler,
>      primarily for the purpose of experimenting with different features, and
>      to see how much an already good product could be improved.  This new
>      assembler kept the original object file format (even though we were very
>      tempted to remove various historical 24-bit restrictions in that format).

>      I'm not familiar with certain S/370 simulation environments like Assist
>      or Hercules, but they may have similar development-friendly features.



Wed, 20 Aug 2003 01:59:30 GMT  
 OS for IBM 370

Quote:


(snip)
>>S/370 assembler is much easier to learn than many popular processors
>>today.  The addressing modes are simple, but powerful.
>>The IBM assemblers have a macro feature much better than newer
>>processors.   If you are writing your own OS, you may need to
>>write your own assembler, too.  Much of the assembly language is
>>related to the operating system.
>I agree with your characterisation of S/370 assemblers, except for this:
>The IBM assembly *language* is actually unrelated to any particular
>operating system.  The assembler as a program does expect a certain
>environment -- a real or simulated subset of OS/390, effectively.  That
>is sufficient for cross-assembly from one operating system (development
>environment) to another (your experimental OS in a test environment).

I would have thought that before, but, as far as I know, the
gas with Linux/390 looks much more like other machines assembly
language than it looks like the language that IBM assemblers
accept.

It could, for example, differ in the operand order on the
instruction, the way of representing registers and offsets,
the ways of representing address constants or data areas,
and more.  Hopefully the instruction mnemonics are the same,
but just about everything else could change, and it could
still assemble for the same hardware.

It would be nice to have programs that could convert between gas
output and OS style LRECL=80 object files, in both directions.

Maybe it is not the OS but the OS philosophy that I was thinking
about.  

thanks for the reply,

-- glen



Wed, 20 Aug 2003 02:48:17 GMT  
 OS for IBM 370
Source for OS/360 is available for download,
only 117 Meg.  There is a pointer to it on
the Hercules emulator site . . .

However, this source is NOT recommended
as example of good programming style --
read Fred Brook's "The Mythical Man Month"
to find out why.
--
Kevin G. Rhoads, Ph.D. (The Cheshire Cat for official Internet mascot.)



Wed, 20 Aug 2003 06:53:35 GMT  
 OS for IBM 370

Quote:
> Source for OS/360 is available for download,
> only 117 Meg.  There is a pointer to it on
  ~~~~
> the Hercules emulator site . . .

Back in its day the word "only" wasn't used in this context.


Wed, 20 Aug 2003 08:38:02 GMT  
 OS for IBM 370

Quote:

>>I'm rather new to assembly lang. and I have a college class we are
>>having to write a very watered down version of an OS for the IBM370
>>mainframe.  I was wondering if anyone could point me to some good
>>information on writing the OS or on assembly in general.  The concepts
>>arn't killing me but Assembly is.

>I would at least have a copy of "IBM/370 Principles of Operation".

>It has all the details of the hardware, and a little about operating
>system related instructions.  IBM will sell you one for $11.25
>plus tax.  UPS ground shipping is included, air shipping extra.

>Order GA22-7000-10  (call 1-800-879-2755).

>Note that many features have been added since then, as 370/XA,
>370/ESA, 390/ESA and Z, but the added features make the newer
>books somewhat less readable.  If your goal is really S/370 that
>is the one you should have.  That will have all the details on
>the hardware instructions.

>S/370 assembler is much easier to learn than many popular processors
>today.  The addressing modes are simple, but powerful.
>The IBM assemblers have a macro feature much better than newer
>processors.   If you are writing your own OS, you may need to
>write your own assembler, too.  Much of the assembly language is
>related to the operating system.

>You might look at the gas (GNU assembler) that now exists for
>assembling under Linux/390.  It should be possible to run as a
>cross assembler, and generate S/370 code running on another
>processor.  Note that its input is very different from the
>input to the IBM assemblers, even though the hardware is the
>same.

>I hope this helps.  If not, ask more.

>-- glen

Wow, that's a pretty hard core assignment.  I suppose it's possible,
but it would be really easy to get bogged down in things like I/O.

And, speaking of which, make sure you get the right Principles of
Operation manual.  If you're really writing a mini-OS for an IBM
System/370, then the referenced manual is the correct one.  However,
if you're going to be running the mini-OS on a more recent system,
then that's the wrong PoO to get.  IBM changed the I/O subsystem
completely from the S/370 to the 370/XA.  Thus, if you try to use the
information in the S/370 PoO to write the mini-O/S, then it definitely
won't run on a 370/XA, ESA/370, ESA/390, or z/Architecture machine [1].

The order numbers for the manuals are:

S/370            GA22-7000-10
370/XA           SA22-7085-1
ESA/370          SA22-7200-0
ESA/390          SA22-7201-06
z/Architecture   SA22-7832-00

Dave

[1] Yes, I realize that certain machine models, such at the 308x series,
could be IMLed in either S/370 or 370/XA mode, depending upon the microcode
load.  However it would surprise me a bit if any educational institution
would have a machine this old, or would be willing to IML it in S/370 mode
just for this purpose.  The other alternative is that a VM system could be
used to simulate a virtual S/370.  However, I seem to remember that recent
versions of VM won't emulate a S/370.

P.S. Standard Disclaimer: I work for them, but I don't speak for them.



Tue, 19 Aug 2003 21:34:32 GMT  
 OS for IBM 370
Hi folks:

.....

Quote:
>      I'm not familiar with certain S/370 simulation environments like Assist
>      or Hercules, but they may have similar development-friendly features.

I've been away from I.B.M. mainframes for nearly 20 years, but I
did some rather useful things with the 370 assemblers.  One was
a batch student programming sub-monitor running under HASP (now
JES2) that I coded and debugged in prototype using John Ehrman's
SPASM assembler, and then moved it to Assembler F to install it
under HASP (please excuse the antiquities).  It ran the student
programming service (a biiig room full of key punches, a card
reader, a printer, several compilers(WATFOR, Algol W, PL/C for
the PL/I types, ....) for several years at Queen's University
here in Kingston.  

SPASM (Single Pass Assembler) was done at Stanford Univerity to
enable teaching assembler.  It compiled 360/370 assembler code
(+ a few very nice extensions, especially in the macro area) into
live 360 instructions in a core data area, and then executed the
instructions by interpreting them.  The assembly-time diagnostics
were thorough and excellent, and the run-time diagnostics were
good.  This was a batch system, not in any sense an interactive
one, but the diagnostic diagnostic aids, though few, were well
chosen and very effective.

I hope that you can still get it; I have heard that it's in the
SHARE library.

Many others have used Assist (now Assist/I) in a similar way,
although I understand that this family of assemblers does not
interpret the instructions.  

I don't know Hercules.  

All the best.

John.

--

48 Fairway Hill Crescent, Kingston, Ontario, Canada, K7M 2B4.
Phone:  (613) 546-6988   Fax:  (613) 542-6987



Wed, 20 Aug 2003 23:14:13 GMT  
 OS for IBM 370

Quote:

>> Source for OS/360 is available for download,
>> only 117 Meg.  There is a pointer to it on the Hercules emulator site
>  ~~~~
> Back in its day the word "only" wasn't used in this context.

Let's see. Assume 2314 disks (I never worked directly with 2311s). 7294
bytes per track (unless I use R0 as a full-track block), 20 tracks per
cylinder, so I need about 800 cylinders, right? Of course, if that's 117
Meg zipped, it's over 250 meg unzipped as 80-byte source images, so our
disk requirement goes to 2000 cylinders.

--



Thu, 21 Aug 2003 05:39:15 GMT  
 OS for IBM 370

Quote:

> >> Source for OS/360 is available for download,
> >> only 117 Meg.  There is a pointer to it on the Hercules emulator site
> >  ~~~~
> > Back in its day the word "only" wasn't used in this context.

> Let's see. Assume 2314 disks (I never worked directly with 2311s)...

IIRC, it was 29 meg per disk pack, and five disks per 2314, so you
should be able to fit it all on one unit.  Of course, you won't have
space for anything else to run the company unless you have multiple
disk systems.

It just amazes how today we think 117 Meg is "nothing".  In the days
that OS/360 was written, it was quite a lot.

Our S/360-40 DOS operating system required all of 16K core memory.

I'm not sure what the low end S/360 minimum memory offering was--16K,
or even 8K.  Those numbers sound absurbly low today, but in those days
the 1401, the most common machine, maxed out at 16K, and many users
had smaller machines.



Thu, 21 Aug 2003 05:47:47 GMT  
 OS for IBM 370

Quote:


> >> Source for OS/360 is available for download,
> >> only 117 Meg.  There is a pointer to it on the Hercules emulator site
> >  ~~~~
> > Back in its day the word "only" wasn't used in this context.

> Let's see. Assume 2314 disks (I never worked directly with 2311s). 7294
> bytes per track (unless I use R0 as a full-track block), 20 tracks per
> cylinder, so I need about 800 cylinders, right? Of course, if that's 117
> Meg zipped, it's over 250 meg unzipped as 80-byte source images, so our
> disk requirement goes to 2000 cylinders.

IIRC, the 2311's were 7.25 MB per spindle, same no. of tracks, half the
no. of R/W heads.

LiamD



Thu, 21 Aug 2003 05:48:22 GMT  
 OS for IBM 370

Quote:

> IIRC, it was 29 meg per disk pack, and five disks per 2314, so you
> should be able to fit it all on one unit.  Of course, you won't have
> space for anything else to run the company unless you have multiple
> disk systems.

> It just amazes how today we think 117 Meg is "nothing".  In the days
> that OS/360 was written, it was quite a lot.

> Our S/360-40 DOS operating system required all of 16K core memory.

> I'm not sure what the low end S/360 minimum memory offering was--16K,
> or even 8K.  Those numbers sound absurbly low today, but in those days
> the 1401, the most common machine, maxed out at 16K, and many users
> had smaller machines.

five spindles for a "short" 2314. A regular 2314 had 9 spindles
... only eight were addressable at any one time and a ninth
"spare". The 9-spindle 2314s had 8 addressing plugs, it was possible
to mount a new pack on the 9th drawer, bring it up to speed, and pop
out the addressing plug from one of the other drives and pop it into
the drive with the recently mounted pack.

random refs (including URL for  picture of 9-drive 2314 string)
http://www.garlic.com/~lynn/2001b.html#7

random other refs:
http://www.garlic.com/~lynn/95.html#8
http://www.garlic.com/~lynn/95.html#10

--



Thu, 21 Aug 2003 09:59:08 GMT  
 OS for IBM 370

Quote:


> > >> Source for OS/360 is available for download,
> > >> only 117 Meg.  There is a pointer to it on the Hercules emulator site
> > >  ~~~~
> > > Back in its day the word "only" wasn't used in this context.

> > Let's see. Assume 2314 disks (I never worked directly with 2311s)...

> IIRC, it was 29 meg per disk pack, and five disks per 2314, so you
> should be able to fit it all on one unit.  Of course, you won't have
> space for anything else to run the company unless you have multiple
> disk systems.

> It just amazes how today we think 117 Meg is "nothing".  In the days
> that OS/360 was written, it was quite a lot.

> Our S/360-40 DOS operating system required all of 16K core memory.

Depending on the time frame & your supervisor generation parameters, you
made have had a 6K supervisor & a 10K problem program area (no
multi-programming). Pretty common setup early on (no multi-programming).

Quote:
> I'm not sure what the low end S/360 minimum memory offering was--16K,
> or even 8K.  Those numbers sound absurbly low today, but in those days
> the 1401, the most common machine, maxed out at 16K, and many users
> had smaller machines.

The smallest S/360's (I think this includes the Mod 20's, but I'm
certain about the 30's & up) were 8K. The idea was to use BOS 8K DISK,
4K supervisor & 4K problem program area. That's the configuration I
learned Assembler on in 1966.

LiamD



Thu, 21 Aug 2003 12:10:48 GMT  
 OS for IBM 370

Quote:
>> Source for OS/360 is available for download,
>> only 117 Meg.  There is a pointer to it on
>  ~~~~
>> the Hercules emulator site . . .

>Back in its day the word "only" wasn't used in this context.

I started coding on 360's (BAL, PL/I, fortran and Cobol), PDP-8s
(assembly, Focal), and CDC-6000 series (Fortran, Cobol and assembler)
in the mid/late 60's --

The "only" preceeding the "117 Meg" was intended as humor (or maybe
sarcasm).  I am still, at some fundamental level, deeply offended by
300+ kb "hello world" programs and multi-megabyte word processor
and spreadsheet packages (just as a few examples).

(All I really wanted was a 360/50, moderately equipped, with OS/PCP
and H level Fortran and PL/I, BAL and basic system utilities.  Now I've
got a desktop box that has more processing power and storage, and
some excellent Fortran compilers (even a few Cobols and PL/Is) and
there are tons of bloatware that want to puke DLLs and hogacious
BMPs &c all over the hard drives . . .  I am thankful for what I've got,
and incredibly offended by <well you know>.)
--
Kevin G. Rhoads, Ph.D. (The Cheshire Cat for official Internet mascot.)



Fri, 22 Aug 2003 04:57:33 GMT  
 
 [ 26 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Programming in OS Assembler Language for the IBM 370

2. IBM system 370

3. IBM Mainframe 370

4. IBM/370 architecture specification

5. FA: Assembler Language Programming for the IBM 370

6. IBM 370 Mainframe Board for the PC

7. FS: IBM System/370 Emergency Pull Knob

8. ibm pc/370 -- what is this beast???

9. IBM 370 ASM to C

10. IBM 370 Assembler Emulator for WIN95

11. ibm 370 emulator for Dos or Win?

12. IBM 370 ASM emulator from Micro Focus

 

 
Powered by phpBB® Forum Software