| Microware OS-9 Support Links | ||||||
|---|---|---|---|---|---|---|
| Home | Training | Resources | TECH-CHECK | History | Registered Support | Logout |
Last updated on 2/18/2005.
I get an error when running my program, but I can't find where these are documented?
When trying to run a module, I get the message "Can't load "J"?These error messages and their meanings can be found in Appendix C of the 'OS-9® Technical Manual' or Appendix E of the 'OS-9000 Technical Manual'. On resident machines, a list of error messages can be found in the SYS directory in a file named 'errmsg'. This can be used to quickly search through to find the meaning of a particular error message. When using the 'mshell' utility, a simple script can be used to simplify the search. Make a hidden file in your home directory (I call mine '.errors') and add the following line to it (you may need to modify the path a bit to fit your setup): grep $(P0) /h0/SYS/errmsg Modify your '.login' file and add an alias to your new '.errors' file similar to: assign e /h1/USR/MARKS/.errors The next time you login, you will be able to quickly determine what an error means by issuing the following command:
$ e 214
000:214 (E$FNA) File not accessible.
$
How can I tell what version of OS-9® I am running?This is found when using the 'shell' utility and happens because 'shell' tries to execute it as a procedure file. The first byte of every OS-9® 68k module is "J" (0x4a). On OS-9000 (X86), the error will be similar, but the first character will be different as the first byte of an OS-9000 X86 module is 0xfc and the second byte is 0x4a. For both systems, add executable permission to the module (attr -x <module>) or load the module into memory (load -d <module>).
If you are a 68K user, you can type 'devs' to get the version of your OS followed by the devices initialized on your system. If you have OS-9® for non-68K, you can do a 'dump -m kernel' and this will output something like:
Super: dump -m kernel
Addr 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 2 4 6 8 A C E
-------- ---- ---- ---- ---- ---- ---- ---- ---- ----------------
00000000 fc4a 0200 78f5 0000 0000 0000 5800 0000 |J..xu......X...
00000010 5505 010c 00a0 6000 0000 0000 0000 0000 U.... `.........
00000020 0000 0000 a800 0000 0000 0000 3819 0000 ....(.......8...
00000030 000c 0000 80d8 0000 c0f1 0000 0000 0000 .....X..@q......
00000040 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000050 0000 0000 0000 c5d5 6b65 726e 656c 0000 ......EUkernel..
00000060 4f53 2d39 3030 302f 7838 3620 5632 2e32 OS-9000/x86 V2.2
00000070 0043 6f70 7972 6967 6874 2028 6329 2031 .Copyright (c) 1
00000080 3938 392d 3139 3937 2062 7920 4d69 6372 989-1997 by Micr
00000090 6f77 6172 6520 5379 7374 656d 7320 436f oware Systems Co
Embedded on the right hand side of this dump is the version of the OS you are running. For instance, you can see this system is running OS-9000 for X86 V2.2.
You can also use the irqs command to show the kernel version.
Why does the RAM disk always appear empty?
OS-9® will automatically initialize a device when it is first used, and deinitialize the device when it is no longer being used. This works fine for normal hardware, but for a RAM disk it would cause the device to initialized (allocate memory, format like a fresh RAM disk), allow use, then on exit the RAM disk would be deinitialized (memory freed). Each access to a non-initialized RAM disk causes it to be created, used, then destroyed. The solution is to iniz /r0 in your startup script or init startup line. iniz causes a device driver to initialize, and deiniz causes a device to be deinitialized (shut down) if no one else is using it.
Normally you would deiniz /r0 the device (make sure no one is using it, or has a path open to anything on the RAM disk or this won't work) and then you iniz /r0 the device again.
If the RAM disk lives in battery backed memory (NVRAM, for example), this won't work since the iniz will end up pointing back to an existing RAM disk file system. format may be used to erase the RAM disk (on much older versions of OS-9, format did not work on RAM disks).
If the disk structure has been damaged, the format may fail. To get around this, block 0 of the RAM disk (LSN0 for OS-9/68K, or LBN0 on non-68K systems) should be erased and then the format utility can be used on it.