Author Topic: SamaruX: Unix-like shell for CP/M.  (Read 1464 times)

0 Members and 1 Guest are viewing this topic.

Offline GeoffB17

  • 6128 Plus
  • ******
  • Posts: 834
  • Country: gb
  • PCW since '85, more CP/M than Loco
    • Awards
Re: SamaruX: Unix-like shell for CP/M.
« Reply #25 on: 19:59, 01 October 21 »
Still playing with this.   Still very interesting, I'm sure it will have a number of uses.

I've now d/l most of the external commands (*.x) files, but had to do them one-by-one.   Not a big deal.

Wondered what the df (disk free) command would do with the uIDE system, there's a problem here.   Not a big deal, but still.

df c: d: e: f:  gives:

c: 1588KB  (12704 recs)
d: 5396KB (-22363 recs)
e: 8136KB (-449 recs)
f: 4196KB ((-31968 recs)

The bytes free figures are OK, the records free numbers are not - I think a signed integer should be a long int?   Will be OK for PCW std floppy disks of course.  Correction, a standard int, but unsigned, would be just enough!

Tried the ls -l command on my c: drive, which has quite a few files on.   Took a long time, but produced a nice listing.   Sorted, which no doubt added to the time.   Interesting to see that the listing shows actual file sizes, i.e. not based on block size, so a number of files that would normally have all been 4k showed as 1k, 2k or 3k.   Maybe this added to the time taken as well?

LOTS more playing to do yet.


Thanks.

Geoff
« Last Edit: 15:28, 02 October 21 by GeoffB17 »
like
0
No reactions

Offline FloppySoftware

  • CPC6128
  • ****
  • Posts: 261
  • Country: es
  • The best team: Amstrad PCW, CP/M, and the Z80 cpu.
    • Floppy Software
    • Awards
Re: SamaruX: Unix-like shell for CP/M.
« Reply #26 on: 04:16, 12 October 21 »

Wondered what the df (disk free) command would do with the uIDE system, there's a problem here.   Not a big deal, but still.

df c: d: e: f:  gives:

c: 1588KB  (12704 recs)
d: 5396KB (-22363 recs)
e: 8136KB (-449 recs)
f: 4196KB ((-31968 recs)

The bytes free figures are OK, the records free numbers are not - I think a signed integer should be a long int?   Will be OK for PCW std floppy disks of course.  Correction, a standard int, but unsigned, would be just enough!


My fault. I'm using %d instead of %u in printf:

Code: [Select]
unsigned int recs;


...


printf("%c: %4d KB (%5d recs.) free\n", 'A' + drv, recs / 8, recs);



I have fixed the issue and uploaded a new df.x command file to the repository.

By the way, I have uploaded today to the repository another build of SamaruX with every command as built-in: SX2.COM.

Thanks for checking and reporting!



« Last Edit: 04:24, 12 October 21 by FloppySoftware »
like
0
No reactions
floppysoftware.es < NEW URL!!!
cpm-connections.blogspot.com.es

Offline GeoffB17

  • 6128 Plus
  • ******
  • Posts: 834
  • Country: gb
  • PCW since '85, more CP/M than Loco
    • Awards
Re: SamaruX: Unix-like shell for CP/M.
« Reply #27 on: 01:05, 19 October 21 »
Thanks for this.

I've just got the new version of df.x, and yes, this looks much better.

I just now guess that if I'd thought about it, I could have tried to 'patch' your original file.   I assume that the code for printf is in the main module, and df.x has just the template as in effect text, so if I used a binary editor I could have changed the %d to %u, assuming the overall process doesn't include any sort of chk.

I note you say you've done SX2, but I'll not bother with that as I'm using the uIDE (so the external commands load fine) and I'm more intersted in experimenting with using cpm xxx commands so I'd rather keep SX smaller.

Did you ever see the WHM (Write Hand Man) system, which has a similar structure although with a different basis.   here there's a memory resident main module which provides a pop-up menu for the 'external' options.   Again, this works much better via the uIDE system, even more so as some options create/edit small data files (editor, diary, etc) and normally the resultant file would be on M: and you need to remember to save the files to disk - this is not necessary with the uIDE!

Geoff
like
1
Members reacted like:
FloppySoftware,