01.06.2013 Views

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

void huge my_putstr(char * pch, int n)<br />

{<br />

//.......<br />

}<br />

void install_mystdio_channel(void)<br />

{<br />

union REGS inregs;<br />

union REGS outregs;<br />

struct SREGS sregs;<br />

}<br />

user_stdio_funcs.user_kbhit = my_kbhit;<br />

user_stdio_funcs.user_getch = my_getch;<br />

user_stdio_funcs.user_putch = my_putch;<br />

user_stdio_funcs.user_putstr = my_putstr;<br />

inregs.h.ah=0x35;<br />

sregs.es =FP_SEG(&user_stdio_funcs);<br />

inregs.x.di=FP_OFF(&user_stdio_funcs);<br />

int86x(0xA0,&inregs,&outregs,&sregs);<br />

void remove_mystdio_channel(void)<br />

{<br />

union REGS inregs;<br />

union REGS outregs;<br />

struct SREGS sregs;<br />

}<br />

inregs.h.ah=0x35;<br />

sregs.es = 0;<br />

inregs.x.di= 0;<br />

int86x(0xA0,&inregs,&outregs,&sregs);<br />

unsigned int set_stdio_channel(unsigned int channels)<br />

{<br />

union REGS inregs;<br />

union REGS outregs;<br />

}<br />

inregs.h.ah=0x33;<br />

inregs.h.al=3; //set both: stdin and stdout<br />

inregs.x.bx = channels;<br />

int86(0xA0,&inregs,&outregs);<br />

return outregs.x.ax;<br />

int main(void)<br />

{<br />

//......<br />

install_mystdio_channel();<br />

set_stdio_channel(0x0E); // COM,TELNET,USER<br />

//....<br />

}<br />

Top of list<br />

Index page<br />

// at the end of the program<br />

set_stdio_channel(0x06); // COM,TELNET<br />

remove_mystdio_channel():<br />

Interrupt 0xA0 service 0x36: Install a System Server Connection Handler function<br />

Installs a user specific System Server Connection Handler function.<br />

The handler function will be called if a client establishes a connection. This functions allows application programmers to implement<br />

their own callback functions for controlling access to the default <strong>@CHIP</strong>-<strong>RTOS</strong> servers.<br />

Parameters<br />

AH<br />

Must be 0x36.<br />

Page 99 / 400

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!