Leland:

If you don't specify PARMREGS then you don't get a trailing X'00'. And,
you only get a trailing X'00' if the PARM is shorter than the size that
the PARMREGS value implies. The documentation doesb't say this, but the
code does.

Romney

On Wed, 5 Mar 2003 22:00:38 -0600 Lucius, Leland said:
>> -----Original Message-----
>> From: Romney White [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, March 05, 2003 7:49 PM
>> To: [EMAIL PROTECTED]
>> Subject: Re: Kernel patch to add VM IPL PARM support
>>
>>
>> Lucius:
>>
>> The string provided by z/VM is terminated by a byte of binary zero, at
>> least according to the CP Command and Utility Reference. If it is, it
>> should be easy to find the end of the values supplied on IPL.I would
>> recommend ensuring the high-order byte of GR0 is zero when the SAVESYS
>> command is issued to create the NSS.
>>
>I'd read that bit in the manual too, but when Adam got the garbage at the
>end of the kernel parms, I thought I'd verify it for myself.
>
>So, I set a trace and started up Linux:
>
>    tr i r 10000
>    Ready; T=0.01/0.01 03:28:53
>
>    i 4000 clear
>    Tracing active at IPL
>     -> 00010000  LM    980F0180    00000180    CC 0
>
>Took a look at the registers, and, de to the "clear", zeros made since :
>
>    d g0-3
>    GPR  0 =  00000000  00000000  00000000  00000000
>
>So, I set GR0-3 to a known value of x'ffffffff':
>
>    st g0 ffffffff g1 ffffffff g2 ffffffff g3 ffffffff
>    Store complete.
>
>    d g0-3
>    GPR  0 =  FFFFFFFF  FFFFFFFF  FFFFFFFF  FFFFFFFF
>
>And saved the system (without PARMREGS):
>
>    defsys LX24M 0-ff ew 100-2ff sr 300-4ff ew minsize=64m
>    HCPNSD440I The Named Saved System (NSS) LX24M was successfully defined
>in fileid 0073.
>
>    savesys LX24M
>    HCPNSS440I Named Saved System (NSS) LX24M was successfully saved in
>fileid 0073.
>
>To show that the registers were truly saved with x'ffffffff', I IPL'd the
>NSS and took a look:
>
>    tr all
>
>    i LX24M
>    Tracing active at IPL
>        00010004  STM   900F0180 >> 00000180    CC 0
>
>    d g0-3
>    GPR  0 =  FFFFFFFF  FFFFFFFF  FFFFFFFF  FFFFFFFF
>
>So, now for the true test:
>
>    i LX24M parm 123
>    Tracing active at IPL
>     -> 00010004  STM   900F0180 >> 00000180    CC 0
>
>    d g0-3
>    GPR  0 =  F1F2F3FF  FFFFFFFF  FFFFFFFF  FFFFFFFF
>
>You'll notice that an x'00' is NOT supplied at the end of the PARM value as
>is indicated by the manual.  Suprised the heck out of me, but it certainly
>explained why Adam was getting the garbage characters.
>
>You're suggestion of setting the high byte of GR0 would work for the case
>when no PARMs were supplied, but the idea would need to be extended to all
>registers in case any PARMs were supplied to ensure a null terminated
>string.  PARMREGS=0-15 seems to take care of this, but either way would work
>fine.  (As does the IPL ... CLEAR.)
>
>> The "case thing" is a problem if you issue the IPL command
>> manually. In
>> an EXEC, you can pass the parameter value in the case you prefer.
>>
>Excellent and bummer.  It's great that there's an ASIS way of doing it, but
>the bummer is now I gotta figure out how to handle it in the kernel for both
>cases.
>
>Thanks much,
>
>Leland

Reply via email to