[Search for users]
[Overall Top Noters]
[List of all Conferences]
[Download this site]
| Title: | Languages | 
| Notice: | Speaking In Tongues | 
| Moderator: | TLE::TOKLAS::FELDMAN | 
|  | 
| Created: | Sat Jan 25 1986 | 
| Last Modified: | Wed May 21 1997 | 
| Last Successful Update: | Fri Jun 06 1997 | 
| Number of topics: | 394 | 
| Total number of notes: | 2683 | 
214.0. "$CMKRNL Problem?" by ALBANY::MULLER () Mon Nov 28 1988 16:39
    Can anyone please tell me why the second file, USER.OUT, is not
    created? KRNL.OUT is created ok.  Requires /PRIV=CMKRNL! 
    
    Fred 
    
[INHERIT ('SYS$LIBRARY:STARLET.PEN')]
PROGRAM kout(INPUT,OUTPUT);
VAR	user_out : TEXT;
	sys_stat : INTEGER;
[EXTERNAL] PROCEDURE LIB$STOP(%IMMED cond_value: INTEGER); EXTERN;
[ASYNCHRONOUS] PROCEDURE main;
VAR	krnl_out : [VOLATILE] TEXT;
BEGIN
OPEN(FILE_VARIABLE:=krnl_out,FILE_NAME:='KRNL.OUT',HISTORY:=NEW);
REWRITE(krnl_out);
WRITELN(krnl_out,'In KRNL mode.');
CLOSE(krnl_out);
END;
BEGIN
sys_stat := $CMKRNL(main);
IF (sys_stat <> SS$_NORMAL) THEN LIB$STOP(sys_stat);
OPEN(FILE_VARIABLE:=user_out,FILE_NAME:='USER.OUT',HISTORY:=NEW);
REWRITE(user_out);
WRITELN(user_out,'Got by $CMKRNL');
CLOSE(user_out);
END.
    
| T.R | Title | User | Personal Name
 | Date | Lines | 
|---|
| 214.1 | wrong notes file | TLE::MAILMAN | Steve Mailman | Tue Nov 29 1988 12:20 | 8 | 
|  |     You can't use RMS (and therefore any of Pascal's I/O) in kernel
    mode...  KRNL.OUT could not have been created by this program.
    
    The $CHKRNL system service requires a routine that returns
    a status value in R0.  You are passing a Pascal PROCEDURE
    which does not return a value therefore $CHKRNL is returning
    garbage and the "IF (sys_stat <> SS$_NORMAL) " is checking
    garbage.
 |