[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference 7.286::atarist

Title:Atari ST, TT, & Falcon
Notice:Please read note 1.0 and its replies before posting!
Moderator:FUNYET::ANDERSON
Created:Mon Apr 04 1988
Last Modified:Tue May 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1433
Total number of notes:10312

351.0. "Help with Mark Will. "C"" by DSM::GOULD (Caress of Steel) Tue Dec 27 1988 11:01

Mark Williams C version 3.0.5

Well, I just bought myself a present. I got Mark Williams C. 
I am real excited about using it. Eventually I will be getting hard disk
drive. But for at least the next year I will only be using a 1040 ST with
one internal double sided floppy.

The documentation is great except for a few things, It lacks any real detailed
information about you are supposed to use the software with only a single
doiuble sided floppy. It mentions that you should make a RAM disk and keep
either the compiler or the MSH and MicroEmacs software in the RAM disk. It does
not explain really the correct way od oding this, whoch EXACT modules should
go in the RAM disk. It does not explain whoch would be better for for
performance or convenience. The book does a great job at introducing the system
and telling what ti will do. But is has no practical examples of a complete
environment. How things go together. 

For example, one the system is installed you end up with 3 disks,
the "sources", "compiler" and "commands". It really does not explain
each of these disks and their usage. If the "commands" are on one disk,
will I have to switch disks at some point when the compiler or MSH needs
them ? When would they need them, how do they fit into the scheme of things.

MY REAL IMPORTANT QUESTION IS THIS :
I want to create 2 systems :

I want to create an environment with just the compiler in a 500K RAM disk,
and my editor and shell on disk. that way programs are created on disk
and when i want to compile them i can place them in the RAM disk. If they
are too big, I can leave them on disk to be compiled. In all cases I want the
compiler to use the RAM disk as the temporary storage place while it compiles.
This is what I want to do. The documentation implies that you can do it
but it only mentions how to create a RAM disk, and explains that certain
parameters in the PROFILE will have to be changed. I need details.
I am confused because, the compiler needs other files that may not be in the
RAM disk at the time. How will it know where they are if it needs them ?
exactly which files to I keep in the RAM disk so the the compiling process is
completely independent of any other disks.
what size should I make the ram disk ?

The next thing,
I want to create an environment where the shell editor and source are in the RAM
disk. When I am ready to compile a program I just want to flip in the "compiler"
disk and away it goes, using the RAM disk again for temporary storage to speed
things up. A common problem, is what do I need to keep in the RAM disk. If
I store just the MSH and ME programs in the RAM disk, there are many commands
that the shell cannot perform cause the information is not there. For example
when I type HELP. The help stuff is on another disk. How exactly to I set
up this environment in a nice neat usable way.
what size should i make the ram disk ?

And about a Bootable RAM disk. Is it better to use these ?
Is there a way so that can have MSH come up automatically. The disk itself
has an auto file with RDY in it so the RAM disk boots automatically. Can I then
put MSH in an auto file within the RAM disk to have it boot up automatically ?


My guess is that the whole answer is within the PROFILE and how it is set up,
but how exactly do I set it up.

what is that darn disk "commands" used for ?
will i ever need the "sources" disk for anything unless i want to look at and
use the sources of the programs provided by the "C" compiler. like MSH or ME ?

Mark williams C has a disk formatter that creates 10 tracks instead of 9. it
is needed to make backups of the installation disks. Should I use this formatter
all the time for all the disks with Mark Williams C. Is there any harm ?

Are there any problems with using 1st word as my editor for "C" ?

Thanks for any help on any of the above questions...a newcomer,
Dave.

p.s. I am really excited about the "C" compiler. So far I love it,
     I am just lacking a bit in knowledge and the documentation needs
     a few more practical examples. But dont get me wrong, I LOVE IT !!    

T.RTitleUserPersonal
Name
DateLines
351.1Congratulations and some answers.PRNSYS::LOMICKAJJeff LomickaTue Dec 27 1988 17:18154
	I have used Mark Williams C in exactly the way you describe - with
	one double-sided drive on a 1040, with the RDY RAM disk.  It can
	be done.  For a program the size and complexity of "Whack", I
	needed a second disk drive,  For my own sanity, I needed a hard
	disk.

	They do not tell you exactly what to put on each disk, because the
	optimum configuration will depend on your program development
	habits.

	Here are some facts that Mark Williams does not make clear, but
	which you must understand before proceeding.

	1. The Mark Williams division onto COMPILER, COMMAND, and SOURCE
	is arbitrary and may be ignored.

	2. The Mark Williams C system uses several "shell environment
	variables" to locate components of itself.  When you issue a
	command, you are usually asking it to run a program.  Some
	programs (ls, cat, and cd - for example) are built into the shell
	itself.  Others (egrep, db, cc, make) are programs that must be
	loaded and executed.  The Mark Williams C shell uses the
	environment variable PATH to locate these programs.  The PATH is a
	comma-separated list of places to look for the programs that go
	with the commands.  The built in commands come from places called
	".bin" or ".cmd", but they are always available, and I have never
	found any real need to understand what these things are.

	Let's assume you build your ram disk as "d:".

	Therefore, for your environemnt, your PATH will contain

		",d:\bin,a:\bin"

	In folder a:\bin ON MORE THAN ONE DISK, you will store the
	commands that you use infrequently.  In the RAM disk folder
	d:\bin, you will store commands you use frequently.

	When you issue a command, the shell will first look in the current
	directory (that's the leading comma), then on the RAM disk, and
	then infolder a:\bin, for a program whose name matches your
	command.

	Likewise the LIBPATH variable handles the search for libraries by ld,
	and the INCLUDE path handles the search for system .H files.  The
	TMPDIR variable is a little different, it contains only one name.

	The division between COMPILER and COMMAND arrises from the need to
	have all the components of the compiler accessible at once in
	order for MAKE to work properly. Therefore, make, cc, cc0-cc3, ld,
	and the /lib folder, and the /include folder, all have to be
	available at once.  The other commands (me, egrep, strip) can be
	stored on another disk, and it is okay to swap to that disk before
	issuing the command.  There just isn't room for all the commands
	to be on the same disk at the same time.  For technical reasons,
	the commands and programs used by the compiler and "make" need to
	all be available without resorting to swapping disks.

	Swapping disks, however, is a problem if your DATA is also on the
	disk.

	When working with a single drive and a RAM disk, I found it
	necessary to put several components of the compiler on the same
	disk as my source files.  So, if I were working on program FOO, I
	would create a disk with folders FOO, BIN, INCLUDE, and LIB, and
	put msh, the compiler phases, make, and some of the libraries on
	this disk.

	I would have a boot disk that contained a RAM disk that was
	preloaded with folders BIN, LIB, and TMP.  In the LIB folder
	I would put LIBC.A, and if workingon GEM program, LIBAES.A and
	LIBVDI.A.  There is a big speed improvement if the libraries are
	on RAM disk.  If there's room, but ME (microemacs) on the RAM
	disk, but be careful to leave enough TMP to be able to compile
	your code.  If it doesn't fit on D:, you need to put ME inthe bin
	folder of your FOO disk.

	Any small (file size) commands that you use frequently should be
	preloaded in BIN of the RAM disk.  If you suddenly decide to use
	the SORT command on your source code, for some reason, you swap in
	the commands disk and "cp a:\bin\sort.prg d:\bin", swap back your
	program disk, and issue the sort command.  You may then have to
	delete d:\bin\sort.prg before you have enough room on the RAM disk
	for TMPDIR.

	So, in summary, you need:

	- COMPILER and SOURCE disks as a place to go to get infrequently
	used commands, but usually you don't use either of them.

	- A boot disk that contains a RAM disk backup that is preloaded
	with

	msh.prg profile�	bin		lib		tmp
				me.prg(?)	libc.a
						libaes.a(?)
						libvdi.a(?)

	- Each application disk:

	<application-folder>	bin		lib		include
	<application source,	me.prg		cc0.prg		stdio.h
	  object, and exe>	cc.prg		cc1.prg		<others you use>
				ld.prg		cc2.prg
						libm.a(?)


	In PROFILE, set up the following:

	setenv PATH ,d:\bin,a:\bin
	setenv LIBPATH d:\lib,a:\lib
	setenv INCLUDE a:\include
	setenv TMPDIR d:\tmp
	
	If you want real speed, find a way to arrange for your .o files to
	appear on the RAM disk as well.  For small programs, I took to
	copying the application folder to the RAM disk, and working there
	with the COMPILER disk in drive a:, but you have to remember to
	copy your files back to floppy before you turn your computer off!
	When doing this, I usually left me.prg on floppy in order to make
	room.

	Things get much easier with a second floppy drive, since
	you can then have your application on a disk of it's own, and swap
	between the COMMANDS and COMPILER disk in the second drive,
	depending on which disk contained the commands you needed.  I
	rarely used the COMMANDS disk, and never the SOURCE disk.  I went
	after COMMANDS when I needed db, sort, egrep, but that's about all.

	From this information, you should be able to figure out what files
	to put where, and what you want to put in PROFILE, in order to do
	the various things that you want with the RAM disk.  If you still
	can't figure out a specific configuration, write back and I will
	help you out with it.

	Regarding the 10 track formatter, I would say that you should not
	use it to store your only copy of some critical data, or to ship
	data to a friend in California, but if it works for you, use it
	for squeezing an extra few bytes out of your limited
	configuration.  I use Twister (came in a magazine) and it never
	fails.

	(The potential for harm with the 10 track formatter is if you use
	the floppy in a drive that spins too fast, the end of the 10th
	track will clobber the start of the first.)

	I can't say yes or not to using 1st word.  The version of
	microemacs I distribute from PRNSYS:: can be given an init file
	that allows you to reprogram the keys the way you want them, and
	has several other nice features that are missing from the one that
	comes with MWC.  I also have ERROR.CMD, which is compatible with
	the microemacs -A switch, which you'll never get 1st word to
	understand.
351.2THANKS, THANKS, THANKS, THANKSDSM::GOULDCaress of SteelWed Dec 28 1988 08:5521
    Thank you so much for all the fantastic information !!
    Your explanation was absolutely clear and very very helpful !!
    
    I "can see the light" and when I get back from NH in 2 days will
    be working and experimenting all weekend.
    
    I am so glad that I found this notes-file. Your one reply probably
    saved me weeks and weeks of phone calls and driving down to the
    store to bug the people I got the software from (who probably know
    nothing about it anyway).
    
    Anyway !!
    
    Thank you, and there is a good chance that I will have a few more
    questions after this weekend.
    
    Have a great New Year,
    
    
    Dave Gould