• Save

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

LP49 SystemCall Gateway

on

  • 800 views

 

Statistics

Views

Total Views
800
Views on SlideShare
799
Embed Views
1

Actions

Likes
2
Downloads
0
Comments
0

1 Embed 1

http://twib.jp 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • <br />
  • <br />
  • &#x3050;&#x308C;&#x3093;&#x3060;&#x304B;&#x308F;&#x3044;&#x3044;&#x3088;&#x3050;&#x308C;&#x3093;&#x3060; <br />
  • <br />
  • &#x30DE;&#x30B8;&#x3081;&#x306A;&#x7406;&#x7531;&#xFF1A;&#x30DE;&#x30A4;&#x30AF;&#x30ED;&#x30AB;&#x30FC;&#x30CD;&#x30EB;&#xFF1A;&#x69CB;&#x9020;&#x304C;&#x7DBA;&#x9E97;&#x3002;&#x7406;&#x60F3;&#x8AD6;&#x3001;&#x8FFD;&#x3063;&#x304B;&#x3051;&#x308B;&#x306E;&#x306F;&#x697D;&#x3057;&#x3044;&#x3088;&#x306D; <br /> &#x8AAD;&#x3080;&#x2212;&#xFF1E;LP49&#x3092;&#x601D;&#x3044;&#x51FA;&#x3059;&#x3002;Plan9&#x3082;&#x307F;&#x3064;&#x3064;, L4&#x3082;&#x898B;&#x308C;&#x308B;&#xFF01; <br /> L4: 10&#x4E07;&#x884C;, Linux: &#x6570;&#x767E;&#x4E07;&#x884C; <br />
  • &#x30BD;&#x30FC;&#x30B9;&#x3068;&#x3064;&#x304D;&#x3042;&#x308F;&#x305B;&#x3066;&#x8AAD;&#x3080;&#x3068;&#x9762;&#x767D;&#x305D;&#x3046;&#x3002;&#x3067;&#x3082;&#x5168;&#x90E8;&#x7167;&#x4F1A;&#x3059;&#x308B;&#x306E;&#x306F;&#x3080;&#x308A;&#x307D; <br /> MINIX&#x8AAD;&#x66F8;&#x4F1A; => oraccha&#x3055;&#x3093;&#x306E;&#x30B7;&#x30B9;&#x30C6;&#x30E0;&#x30B3;&#x30FC;&#x30EB;&#x306B;&#x3064;&#x3044;&#x3066;&#x306E;&#x89E3;&#x8AAC; <br />
  • <br />
  • &#x30B5;&#x30FC;&#x30D3;&#x30B9;&#x306F;&#x30D5;&#x30A1;&#x30A4;&#x30EB;&#x3068;&#x3057;&#x3066;&#x30A2;&#x30AF;&#x30BB;&#x30B9; <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • &#x30B5;&#x30FC;&#x30D3;&#x30B9;&#x306F;&#x30D5;&#x30A1;&#x30A4;&#x30EB;&#x3068;&#x3057;&#x3066;&#x30A2;&#x30AF;&#x30BB;&#x30B9; <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />

LP49 SystemCall Gateway LP49 SystemCall Gateway Presentation Transcript

  • ( ) Glenda @n_kane
  • @n_kane Glenda Glenda
  • YES! He is CUTE!
  • L4 + Plan9 = LP49 ( @n_kane )
  • LP49 Plan9 on L4 NII L4 Plan9
  • Why MicroKernel ? : http://www35.atwiki.jp/futsuu LP49 !
  • “LP49 ” by H2O ≒ Plan9 Internals
  • “LP49 ” by H2O ≒ Plan9 Internals
  • Plan 9 LP49
  • “ ” Plan9 Apps 9P Server libc User Kernel Plan 9 Kernel chan.c driver
  • mount /sys/include/libc.h extern int mount(int, int, char*, int, char*);
  • mount src/libc/9syscall/sys.h ....... #define FWSTAT 45 #define MOUNT 46 #define AWAIT 47 ....... src/libc/9syscall/_mount.s TEXT mount(SB), 1, $0 MOVL $46, AX INT $64 RET
  • mount src/9/pc/l.s TEXT vectortable(SB), $0 CALL _strayintr(SB); BYTE $0x00 /* divide error */ CALL _strayintr(SB); BYTE $0x01 /* debug exception */ CALL _strayintr(SB); BYTE $0x02 /* NMI interrupt */ CALL _strayintr(SB); BYTE $0x03 /* breakpoint */ ........ CALL _strayintr(SB); BYTE $0x3E CALL _strayintr(SB); BYTE $0x3F CALL _syscallintr(SB); BYTE $0x40 /* VectorSYSCALL */ CALL _strayintr(SB); BYTE $0x41 .........
  • mount src/libc/9syscall/_mount.s TEXT _syscallintr(SB), $0 PUSHL $VectorSYSCALL /* trap type */ PUSHL DS PUSHL ES .... CALL syscall(SB) ..... POPL ES POPL DS ADDL $8, SP /* pop error code and trap type */ IRETL
  • mount src/9/pc/trap.c void syscall(Ureg* ureg) { .... scallnr = ureg->ax; .... ret = systab[scallnr](up->s.args); .... }
  • mount src/9/port/systab.h #include "/sys/src/libc/9syscall/sys.h" typedef long Syscall(ulong*); ..... Syscall sysmount; .... Syscall *systab[]={ .... [MOUNT] sysmount, .... }
  • mount src/9/port/sysfile.c long sysmount(ulong *arg) { return bindmount(1, arg[0], arg[1], nil, (char*)arg[2], arg[3], (char*)arg[4]); } chan.c To the deeper Plan 9 World
  • “ ” Plan9 Apps 9P Server libc User Kernel Plan 9 Kernel chan.c driver
  • LP49 Apps LP49 9P Server Pager libc Core User Servant Kernel L4 Kernel
  • • LP49Core(=Plan9 Kernel) • IPC • no
  • mount /sys/include/libc.h extern int mount(int, int, char*, int, char*); /sys/src/libc/9syscall/_mount.s : TEXT mount(SB), 1, $0 MOVL $46, AX INT $64 RET Plan 9
  • mount /sys/include/libc.h extern int mount(int, int, char*, int, char*); /sys/src/libc/9syscall-l4/mount_.c : int mount(int fd, int afd, char* old, int flag, char* aname) { return syscall_iisis(MOUNT, fd, afd, old, flag, aname); } LP49
  • mount /src/libc/9syscall-l4/ipc-l4.h #define INLINE static inline INLINE int syscall_(int syscallnr) INLINE int syscall_a(int syscallnr, void* arg0) INLINE int syscall_aa(int syscallnr, void* arg0, void* arg1) INLINE int syscall_ai(int syscallnr, void* arg0, int arg1) INLINE int syscall_i(int syscallnr, int arg0) INLINE int syscall_ia(int syscallnr, int arg0, void* arg1) INLINE int syscall_iai(int syscallnr, int arg0, void* arg1, int arg2) INLINE int syscall_aim(int syscallnr, void* arg0, int arg1, L4_MapItem_ INLINE int syscall_iaim(int syscallnr, int arg0, void* arg1, int arg2, L4_M INLINE int syscall_iaii(int syscallnr, int arg0, void* arg1, int arg2, int ar INLINE int syscall_iaiii(int syscallnr, int arg0, void* arg1, int arg2, int ar INLINE int syscall_iaiiim(int syscallnr, int arg0, void* arg1, int arg2, int INLINE int syscall_ii(int syscallnr, int arg0, int arg1) INLINE int syscall_iii(int syscallnr, int arg0, int arg1, int arg2)
  • INLINE int syscall_iisis(int syscallnr, int arg0, int arg1, char* arg2, int arg3, char *arg4) { ...... L4_MsgClear(&msgreg); L4_Set_MsgLabel(&msgreg, syscallnr); L4_MsgAppendWord(&msgreg, patrn); L4_MsgAppendWord(&msgreg, arg0); //arg0 i ..... L4_MsgLoad(&msgreg); tag = L4_Call(SrvManager); if (L4_IpcFailed(tag)) return -1; //XXX L4_MsgStore(tag, &msgreg); result = L4_MsgWord(&msgreg, 0); return result; }
  • src/9/port/syssrv-l4.c void clerk_thread() // main() { .... while(1) { L4_MsgClear(&_MRs); tag = L4_Receive(SrvManager); //L4_Wait(&manager); ..... rcode = (*systab[syscallnr])(myjob->args, myjob); .... tag = L4_Reply(myjob->client); .... } }
  • src/9/port/syssrv-l4.c void clerk_thread() // main() { .... while(1) { L4_MsgClear(&_MRs); tag = L4_Receive(SrvManager); //L4_Wait(&manager); ..... rcode = (*systab[syscallnr])(myjob->args, myjob); .... tag = L4_Reply(myjob->client); .... } }
  • chan.c