
Child process execution by Filer
Filer releases 64KB of 0x110000 - 0x11FFFF as the user memory.  The usual application is loaded to this memory range (0x10F200 - 0x11FFFF if additional area is included). 

In addition, as the following map shows, 0x10D700 - 0x10F1FF is the memory range that an application can be executed from Filer as a child process.
The stack is inherited as they are.

The title display ("B:\system\apps\dsd2.exf") of the schedule alarm match is an application that takes this memory range.  This is running as a child process without terminating the usual application. 

Address            		Usage                 		Size
0x10D700 - 0x10F1FF 	filer (for child process)   6.75KB
0x10F200 - 0x10FFFF 	additional                  3.50KB
0x110000 - 0x11FFFF 	User area              	    64.00KB(stack is included)


* Usual application execution
                          Application
    Filer                  execution           Application
  +-------------------+ ->->->->->->->->->->+--------------------+ 
  |Application        |     Application     |Application process |
  |execution          |     termination     |                    |
  |                   |<-<-<-<-<-<-<-<-<-<- +--------------------+ 
  |Next application   | 
  |execution          | Next application   Next application
  |Another application| execution           +-------------------+ 
  |execution          |->->->->->->->->->-> |                   | 
  +-------------------+                     |Application process|
                                            |                   |
                                            +-------------------+ 


* Child process execution
                  Application
    Filer         execution         Application
  +-----------+->->->->->->->- +-------------------+ 
  |Application|                |Application process|  Alarm
  |execution  |                |                   |->->->->->+-------------+ 
  |           |                |                   |          |Child process|
  |           |                |                   |<-<-<-<-<-+-------------+ 
  |           |                |                   |
  +-----------+                +-------------------+ 
                                 




User Alarm
When the time matches to the specified alarm time (alarm match of year, month, day, hour, minute), the alarm sounds and the execution format file is executed.

Sound the specified sound file (in B:\system\sound directory) and start the specified application by 0-3 year, month, day, hour, minute of user data in B:\system\alarm.ini.


User 0,1 
 Start as a child process.
    (Only application which can be fit within 0x10D700 - 0x10F1FF on the memory map.)

User 2,3
 Start as the usual user application.  Start it after the current application is terminated.



User 0 is used as the schedule alarm.  Therefore, you should not change this part.


[How to register the User alarm]

 The following is the structure of B:\system\alarm.ini.

    #define SNDFILENAMESIZE 8
    #define PATHSIZE 32       /* The maximum character number of an execution exf file full path name */

    typedef struct {
        unsigned short year;
        unsigned short month;
        unsigned short day;
        unsigned short hour;
        unsigned short min;
        char snd[SNDFILENAMESIZE]; /* 8 characters in B:\system\sound and extension is excluded */
        char exf[PATHSIZE];        /* Full path specification ".EXF" is included (within 32 character) */
    } EVENTTABLE;


 The following four definition are prepared for the 32 byte EVENTTABLE structure from the beginning of the file.

  + 0h ~ Used as the schedule alarm (users cannot be used)
  +32h ~ User 1 (child process is running)
  +64h ~ User 2 (Usual user application)
  +96h ~ User 3 (Usual user application)

 As an example, the setting method of <alarmini.c> is shown.  It can be compiled on PC.


By registering the updated alarm.ini to the system memory of Filer, the detection of alarm match of year, month, day, hour and minute is started.

Procedure
(1)Update the user data of alarm.ini.
 If you update the data on PC, you need to transfer it to B:\system of onHand/Ruputer.
 The transferred alarm.ini is automatically updated when "CheckExecute()" is called within Filer at the time of the remote connection termination.

(2)Call onHand/RuputerAPI "setAlarm()"
 Register the alarm time, alarm file name and execution file name to the system resource of Filer.
 Optionally, if you call onHand/RuputerAPI "CheckExecute()", the schedule alarm is also updated.

 Do not write the data to any system resource directly other than the above mentioned setAlarm() and CheckExecute().



Change the memory address to be loaded to the child process for execution

Linker option -Ttext=0x10D800 should be set.
Please note that OS uses 0x100 byte that is located before the beginning of the loading address as PSP area.

In addition, for a parent application, this child process should be started by onHand/RuputerAPI function ChildExecute().

You should follow the return value that indicates the termination of application of Keyin(), EventCall() and EventExec().


-----<Hint>-----
 At 7:00 a.m., remote control .exf is started with the alarm sound and turn on T.V.  And the volume of the T.V. increases every one minute.  How about this?

===============================================================================
 Copyright (c) 1998-1999.  Seiko Instruments Inc.  All rights reserved. 
===============================================================================
