io-pkt
ãããã¯ãŒã¯ç®¡çè ã«ã€ããŠå°ã説æãã次ã«Qnetãããã³ã«ã«ã€ããŠè©³ãã説æããŸãã ç©èªã®éçšã§ã4ã€ã®åæ çããã³1ã€ã®æè¡çè±ç·ãç§ãã¡ãåŸ ã£ãŠããŸãã
Qnetãšã¯äœã§ããïŒ
QNXãããã¯ãŒã¯ã¯ãçžäºæ¥ç¶ãããã¿ãŒã²ããã·ã¹ãã ã®ã°ã«ãŒãã§ããããããããQNX Neutrino RTOSãå®è¡ããŠããŸãã ãã®ãããªãããã¯ãŒã¯ã§ã¯ãããã°ã©ã ã¯ãã¹ãŠã®ããŒãïŒããŒããããã¯ãããã¯ãŒã¯äžã®åã ã®ã³ã³ãã¥ãŒã¿ãŒã®ååïŒäžã®ãªãœãŒã¹ã«ã¢ã¯ã»ã¹ã§ããŸãã ãªãœãŒã¹ã¯ããã¡ã€ã«ãããã€ã¹ããŸãã¯ããã»ã¹ïŒå¥ã®ããŒãã§ã®ããã»ã¹ã®èµ·åãå«ãïŒã§ãã åæã«ãã¿ãŒã²ããã·ã¹ãã ïŒãããã®ããŒãïŒã¯ãx86ãARMãMIPSãPowerPCãªã©ã®ããŸããŸãªã¢ãŒããã¯ãã£ã®ã³ã³ãã¥ãŒã¿ãŒã«ããããšãã§ããŸãïŒQnetã®çŸåšã®å®è£ ã¯ã¯ãã¹ãšã³ãã£ã¢ã³ç°å¢ã§ãæ©èœããŸãïŒã ããããããã ãã§ã¯äžååã§ããããã«ãä¿®æ£ãªãã§QNXã«ç§»æ€ãããPOSIXã¢ããªã±ãŒã·ã§ã³ïŒç§»æ€ã«ã¯åæ§ç¯ã®ã¿ãå¿ èŠãªå Žåãå€ãïŒã«ã¯ãäžèšã®Qnetãããã¯ãŒã¯æ©èœããããŸãã èå³ããããããŠãããã¯ã©ããã£ãŠèµ·ããã®ã§ããããïŒ
Qnetãããã³ã«ã¯ãã¡ãã»ãŒãžã³ã°ãšã³ãžã³ãQNX Neutrinoãã€ã¯ãã«ãŒãã«ãããã¯ãŒã¯ã«æ¡åŒµããŸãã ãã®ãããQnetã®æ倧ã®ç§å¯ãæããã«ãªããŸãããèšäºã®åŸåã§ãããããã¹ãŠãã©ã®ããã«æ©èœããããèŠãŠãããŸãã
åæ
çãªäœè«ãšããŠã
ãã®æçš¿ã¯QNX 6.5.0ã«ã€ããŠã§ãããQNX6ã®ä»ã®ããŒãžã§ã³ãQNX4ãæãåºãããšããããŸãã ãããŠä»ãç§ã¯æãåºããŸãã...ç¬èªã®ãããã¯ãŒã¯ã䜿çšããåæ§ã®ã¢ãããŒãã¯ããããã¯ãŒã¯ãFLEETãšåŒã°ããQNX4ã«ãããŸããã Qnetããã³FLEETãããã³ã«ã¯çžäºã«äºææ§ããªããã³ã¢ã®å®è£
ã®éãã圱é¿ããŸãã ããŒãã®ã¢ãã¬ã¹æå®ã«ãéãããããŸãã ããã«ãããããããåãåçã¯ããã€ã¯ãã«ãŒãã«ãããã¯ãŒã¯ãžã®ã¡ãã»ãŒãžã³ã°ã¡ã«ããºã ã®æ®åã«åºã¥ããŠããŸãã
IO-PKTãããã¯ãŒã¯ãµãã·ã¹ãã
ãããã¯ãŒã¯ãµãã·ã¹ãã ã¯ãQNXãµãã·ã¹ãã ã®1ã€ã®å žåçãªä»£è¡šäŸã§ãã
io-pkt*
管çè ïŒQNXãªãœãŒã¹ãããŒãžã£ãŒãã¯ãããžãŒäžã«æ§ç¯ïŒãããã€ã¹ã¢ãžã¥ãŒã«ïŒãã©ã€ããŒïŒïŒ
devnp-e1000.so
ããããã³ã«ã¢ãžã¥ãŒã«ïŒ
lsm-qnet.so
ãããã³ãŠãŒãã£ãªãã£ïŒ
ifconfig
ããã³
nicinfo
ãªã©ïŒã§
nicinfo
ã ã¡ãªã¿ã«ãQNXã«ã¯
io-pkt-v4
ã
io-pkt-v4-hc
ãããã³
io-pkt-v6-hc
3ã€ã®ãããã¯ãŒã¯ãããŒãžã£ãŒããããŸãã
v4
ãµãã£ãã¯ã¹ã¯ããã®ãããŒãžã£ãŒãIPv4ã®ã¿ããµããŒããã
v6
ããŒãžã§ã³ãIPv4ããã³IPv6ããµããŒãããããšã瀺ããŸãã ãµãã£ãã¯ã¹
hc
ïŒé«å®¹éïŒã¯ãæå·åãšWi-FiããµããŒãããé«åºŠãªããŒãžã§ã³ãæå³ããŸãã ãããã£ãŠãæç®ã§ã¯
io-pkt*
ãšããååãèŠã€ããããšãã§ããŸããããããŒãžã£ãŒ
io-pkt
ïŒã¢ã¹ã¿ãªã¹ã¯ãªãïŒãåŒã³åºããŸãã ç§ãã¡ã®å Žåããã®èšäºã¯Qnetã«é¢ãããã®ã§ããããã話ããŠããTCP / IPã®ããŒãžã§ã³ã¯é¢ä¿ãããŸããã
åæ
çãªäœè«ãšããŠã
QNX6ã®ä»¥åã®ããŒãžã§ã³ã§ã¯ããããã¯ãŒã¯ãããŒãžã£ãŒã¯
ãšåŒã°ããTCP / IPãããã³ã«ã¢ãžã¥ãŒã«ã¯
ãªã³ã¯ãããŠããŸããã§ãããã
ãããªã¹ã¿ã³ãã¢ãã³ã¢ãžã¥ãŒã«
ã
ãŠ
ãã¢ãžã¥ãŒã«ã«ã¯ç°ãªããã¬ãã£ãã¯ã¹ãä»ããŠãããããTCP / IPã¢ãžã¥ãŒã«ã¯
ããã³
ããã³
ãšåŒã°ããŠã
ã åŸè ãå®å šã«çå®ã§ã¯ãããŸããããå€ä»£ïŒQNX 6.3.2ã®æ代ïŒã«ã¯2ã€ã®Qnetã¢ãžã¥ãŒã«ããããŸãã
ïŒQNX6ã®å€ãããŒãžã§ã³ãšã®äºææ§ã®ããïŒãš
ïŒæ°ãããããã³ã«ãQNX 6.5.0ã®
ã¢ãžã¥ãŒã«ã§ãµããŒããããŠ
ãŸãïŒã ã¡ãªã¿ã«ãnpmã¯Network Protocol Moduleã®ç¥ã§ãlsmã¯Loadable Shared Moduleã®ç¥ã§ãã
ã§ã¯ããããã¯ãŒã¯ãã©ã€ããŒã¢ãžã¥ãŒã«ã¯devnãã¬ãã£ãã¯ã¹ãèªã£ãŠããŸãã
ãã©ã€ããŒã«ã¯ãç°ãªãæ¥é èŸdevnpããããŸãã å€ããã©ã€ããŒã
æ¥ç¶ã§ããŸããã
ã¬ã€ã€ãŒã¢ãžã¥ãŒã«ã¯èªåçã«äœ¿çšãããŸãã
io-net
ãšåŒã°ããTCP / IPãããã³ã«ã¢ãžã¥ãŒã«ã¯
io-net
ãªã³ã¯ãããŠããŸããã§ãããã
lsm-qnet.so
ãããªã¹ã¿ã³ãã¢ãã³ã¢ãžã¥ãŒã«
lsm-qnet.so
ã
npm-tcpip-v4.so
ãŠ
npm-tcpip-v6.so
ãã¢ãžã¥ãŒã«ã«ã¯ç°ãªããã¬ãã£ãã¯ã¹ãä»ããŠãããããTCP / IPã¢ãžã¥ãŒã«ã¯
npm-tcpip-v4.so
ããã³
npm-tcpip-v6.so
ããã³
npm-tcpip-v6.so
ãšåŒã°ããŠã
npm-qnet.so
ã åŸè ãå®å šã«çå®ã§ã¯ãããŸããããå€ä»£ïŒQNX 6.3.2ã®æ代ïŒã«ã¯2ã€ã®Qnetã¢ãžã¥ãŒã«ããããŸãã
npm-qnet-l4_lite.so
ïŒQNX6ã®å€ãããŒãžã§ã³ãšã®äºææ§ã®ããïŒãš
npm-qnet-l4_lite.so
ïŒæ°ãããããã³ã«ãQNX 6.5.0ã®
lsm-qnet.so
ã¢ãžã¥ãŒã«ã§ãµããŒããããŠ
lsm-qnet.so
ãŸãïŒã ã¡ãªã¿ã«ãnpmã¯Network Protocol Moduleã®ç¥ã§ãlsmã¯Loadable Shared Moduleã®ç¥ã§ãã
io-net
ã§ã¯ããããã¯ãŒã¯ãã©ã€ããŒã¢ãžã¥ãŒã«ã¯devnãã¬ãã£ãã¯ã¹ãèªã£ãŠããŸãã
io-pkt
ãã©ã€ããŒã«ã¯ãç°ãªãæ¥é èŸdevnpããããŸãã å€ããã©ã€ããŒã
io-pkt
æ¥ç¶ã§ããŸããã
devnp-shim.so
ã¬ã€ã€ãŒã¢ãžã¥ãŒã«ã¯èªåçã«äœ¿çšãããŸãã
å³ 1.
io-pkt
詳现ãã¥ãŒã
io-pkt
ãå³1ã«ç€ºããŸãã äžäœã¬ãã«ã«ã¯ãæç·ããã³ç¡ç·ãããã¯ãŒã¯çšã®ãã©ã€ããŒããããŸãã ãããã¯ããŒãå¯èœãªã¢ãžã¥ãŒã«ïŒDLLãå ±æã©ã€ãã©ãªïŒã§ãã ã€ãŒãµãããã«å ããŠãä»ã®äŒéã¡ãã£ã¢ããµããŒããããŠããããšã«æ³šæããŠãã ããã ããšãã°ããã©ã€ããŒ
devn-fd.so
䜿çš
devn-fd.so
ãšããã¡ã€ã«èšè¿°åïŒfdã¯åãªããã¡ã€ã«èšè¿°åã§ãïŒã䜿çšããŠããŒã¿ã®éåä¿¡ãæŽçã§ãããããããšãã°ã·ãªã¢ã«ããŒãã§ãããã¯ãŒã¯ãæŽçã§ããŸãã ãã¡ãããé床ã¯é©åã§ãããæã«ã¯ããã倧ãã«åœ¹ç«ã¡ãŸãã ããã€ã¹ãã©ã€ããŒã¯ã第2ã¬ãã«ïŒã¹ã¿ãã¯ïŒã®ãã«ãã¹ã¬ããã³ã³ããŒãã³ãã«æ¥ç¶ãããŸãã ã¹ã¿ãã¯ã¯ããŸããããªããžãšãªã¬ãŒã®æ©èœãæäŸããŸãã 第äºã«ãã¹ã¿ãã¯ã¯çµ±äžããããã±ãã管çã€ã³ã¿ãŒãã§ãŒã¹ãšIPãTCPãããã³UDPãããã³ã«åŠçãæäŸããŸãã æäžäœã«ã¯ãã¹ã¿ãã¯ãšãŠãŒã¶ãŒã¢ããªã±ãŒã·ã§ã³éã§ã¡ãã»ãŒãžã®åãæž¡ããå®è£ ãããªãœãŒã¹ãããŒãžã£ãŒããããŸãã é¢æ°
open()
ã
read()
ã
write()
ããã³
ioctl()
ãŸãã
libsocket.so
ã©ã€ãã©ãªã¯ã
io-pkt
ããã»ãšãã©ã®ææ°ã®ãããã¯ãŒã¯ã³ãŒãã®æšæºã§ããBSDãœã±ããã¬ã€ã€ãŒAPIã«å€æããŸãã
ã¹ã¿ãã¯ã¯ãã€ãŒãµãããããã³IPã¬ã€ã€ãŒäžã®ããŒã¿ãæäœããããã®ã€ã³ã¿ãŒãã§ã€ã¹ãæäŸããŸããããã«ãããDLLã®åœ¢åŒã§å®è¡ããããããã³ã«ïŒããšãã°ãQnetïŒãå¿ èŠãªã¬ãã«ïŒIPãŸãã¯ã€ãŒãµãããïŒã«æ¥ç¶ã§ããŸãã å€éšã¢ããªã±ãŒã·ã§ã³ãšã®å¯Ÿè©±ãå¿ èŠãªå Žåããããã³ã«ïŒããšãã°ãQnetïŒã«ã¯ç¬èªã®ãªãœãŒã¹ãããŒãžã£ãŒãå«ãŸããå ŽåããããŸãã ã¹ã¿ãã¯ã«ã¯ããã©ã€ããŒãšãããã³ã«ã«å ããŠãBPFïŒããŒã¯ã¬ãŒãã±ãããã£ã«ã¿ãŒïŒãšPFïŒãã±ãããã£ã«ã¿ãŒïŒã®ãã±ãããã£ã«ã¿ãªã³ã°ãå«ãŸããŠããŸãã
Qnetãããã³ã«ããµããŒãããŠ
io-pkt
ãèµ·åããäŸïŒ
io-pkt-v4-hc -d e1000 -p qnet
-d
ãªãã·ã§ã³ã¯ããããã¯ãŒã¯ã³ã³ãããŒã©ãŒãã©ã€ããŒ
devnp-e1000.so
æå®ãã
-p
ãªãã·ã§ã³ã¯Qnetã¢ãžã¥ãŒã«ãããŒãããŸãã å®éãã€ã³ã¹ããŒã«ãã£ã¹ã¯ããQNXãã€ã³ã¹ããŒã«ãããšããããã¯ãŒã¯ã¯èµ·åã¹ã¯ãªããããèªåçã«èµ·åããŸããéåžžãQNXãåã蟌ã¿ãã·ã¹ãã ã®èµ·åé床ãäžããå Žåã¯ãæåã§èµ·åããå¿ èŠããããŸãã
ã€ãŒãµããããã¬ãŒã ã®äœ¿çšã«å ããŠãQnetã¯IPãã±ããã«ã«ãã»ã«åããããšãã§ããŸãã ããã¯ãããšãã°åæ£ãããã¯ãŒã¯ã§äœæ¥ããå Žåã«äŸ¿å©ã§ãã ãã®å Žåã®ãªãŒããŒãããã³ã¹ããå¢å ããããšã«çæããŠãã ããã Qnet over IPã®å®è¡äŸïŒ
io-pkt-v4-hv -d e1000 -p qnet bind=ip,resolve=dns
äœããã®çç±ã§
io-pkt
ãQnetãµããŒããªãã§èµ·åãããå Žåã
lsm-qnet.so
ã¢ãžã¥ãŒã«ã¯åŸã§
lsm-qnet.so
ã§ããŸãã次ã«äŸã瀺ããŸãã
mount -Tio-pkt lsm-qnet.so
io-pkt
ã«é¢ããããå®å šãªæ å ±ã¯QNXãã«ãã·ã¹ãã ã§ååŸã§ããŸããèšäºã®ã¡ã€ã³ãããã¯ã«é²ã¿ãŸãã
Qnetã¯ã©ã®ããã«æ©èœããŸããïŒ
ãŠãŒã¶ãŒã®èŠ³ç¹ããèŠããšãQnetã¯å®å šã«ééçã«åäœããŸã...åæ¢ããŸãã ãããããã®æèã§åèªã®æå³ãééçã«æããã«ããæã§ããïŒ ããããããã¯æéã§ãã ç§ãã¡ã®å Žåãéææ§ãšããçšèªã¯ããªã¢ãŒããªãœãŒã¹ãžã®ã¢ã¯ã»ã¹ã«ãããŒã«ã«ãªãœãŒã¹ãžã®ã¢ã¯ã»ã¹ãšæ¯èŒããŠè¿œå ã®ã¢ã¯ã·ã§ã³ãå¿ èŠãªãããšãæå³ããŸãã 以äžã®äŸã䜿ã£ãŠèª¬æããŸãã
Qnetãèµ·åãããšããã£ã¬ã¯ããª/ããããäœæãããŸããããã«ãããåãããã¯ãŒã¯ããŒãã®ãã¡ã€ã«ã·ã¹ãã ããããŒãã®ååã§åå¥ã®ãã£ã¬ã¯ããªã«è¡šç€ºãããŸãã ãã¹ãåïŒãã¹ãåïŒãèšå®ãããŠããªãå ŽåïŒã€ãŸããããã©ã«ãåã¯localhostïŒã/ netãã£ã¬ã¯ããªã§ã¯ãMACã¢ãã¬ã¹ã§æ§æãããååãšåŒã°ããŸãã ããšãã°ã次ã®ã³ãã³ãã¯ãzvezdaããŒãã®ã«ãŒããã£ã¬ã¯ããªã®å 容ã衚瀺ããŸãã
ls -l /net/zvezda
次ã®ã³ãã³ãã䜿çšãããšãzvezdaããŒãã®èµ·åã¹ã¯ãªããã®1ã€ãç·šéã§ããŸãã
vi /net/zvezda/etc/rc.d/rc.local
æŽçããããã¡ã€ã«ãžã®ã¢ã¯ã»ã¹ã«ãããããã§ç°åžžãªããšã¯äœããããŸããã ããã€ã¹ãžã®ã¢ã¯ã»ã¹ãåæ§ã«æ©èœããŸãã ãã®ãããããšãã°ãå¥ã®ããŒãã®ã·ãªã¢ã«ããŒãã§äœæ¥ã§ããŸãã
qtalk -m /net/zvezda/dev/ser1
ãããŠãããèå³æ·±ãäŸã次ã«ç€ºããŸãã
phcalc -s /net/zvezda/dev/photon
éåžžãPhotonã¢ããªã±ãŒã·ã§ã³ïŒããã¯æšæºã®QNXã°ã©ãã£ã«ã«ãŠã£ã³ããŠãµãã·ã¹ãã ã§ãïŒã§ã¯ãæ¥ç¶å ã®ãµãŒããŒãæå®ã§ããŸãïŒãªãã·ã§ã³
-s
ïŒã ãã®å Žåãã¢ããªã±ãŒã·ã§ã³ã¯ããŒã«ã«ããŒãã§å®è¡ãããzvezdaããŒãã«ã°ã©ãã£ãã¯ãŠã£ã³ããŠã衚瀺ãããŸãã ããŒã«ã«ãã¹ãã¯ã°ã©ãã£ãã¯ã¹ãµãã·ã¹ãã ãå®è¡ããå¿ èŠãããããŸããã ããã¯ãããŒãã«ã°ã©ãã£ãã¯ã³ã³ãããŒã©ãŒããªãããã»ã³ãµãŒãŸãã¯ã·ã¹ãã ã»ããã¢ããããåéãããããŒã¿ã®ã°ã©ãã£ãã¯è¡šç€ºãå¿ èŠãªå Žåãªã©ãå Žåã«ãã£ãŠã¯äŸ¿å©ã§ãã ãŸãããã®ã¢ãããŒãã«ãããã°ã©ãã£ãã¯ãµãŒããŒã®äžå€®åŠçè£ çœ®ããªãããŒãã§ããŸãã
åæ
çãªäœè«ãšããŠã
説æãããŠããã¢ãããŒãã¯ãã°ã©ãã£ãã¯ã¹ãµãã·ã¹ãã ã ãã§ãªãã以äžãå«ãä»ã®ãµãã·ã¹ãã ã«ãé©çšã§ããŸãã å¥åŠãªããšã«ãããã¯ãŒã¯ã«ååã§ãã ãŸããQNX4ã§äœ¿çšãããããšããããŸããQNX4ã§ã¯ãTCP / IPã¹ã¿ãã¯ã®åå¥ã®ã©ã€ã»ã³ã¹ãå«ããã¢ãžã¥ãŒã«ããšã«åå¥ã®ã©ã€ã»ã³ã¹ãå¿
èŠã§ãã FLEETãããã¯ãŒã¯å
ã®1ã€ã®ããŒãã§ã®ã¿
ãããŒãžã£ãŒ
å®è¡ãããã®ããŒãã«ãã¹ãŠã®ãœã±ããã©ã€ãã©ãªèŠæ±ãéä¿¡ã§ããŸãã å¿é ããå¿ èŠã¯ãããŸãããQNX6ã¯éåžžãããè¡ããŸããã
å Žåãããã¯æå³ããããŸããã TCP / IPã¹ã¿ãã¯ã¯
ãšäžå¯å
ã
Tcpip
ãããŒãžã£ãŒ
Tcpip
å®è¡ãããã®ããŒãã«ãã¹ãŠã®ãœã±ããã©ã€ãã©ãªèŠæ±ãéä¿¡ã§ããŸãã å¿é ããå¿ èŠã¯ãããŸãããQNX6ã¯éåžžãããè¡ããŸããã
io-pkt
å Žåãããã¯æå³ããããŸããã TCP / IPã¹ã¿ãã¯ã¯
io-pkt
ãšäžå¯å
io-pkt
ã
ãã¡ã€ã«ãšããã€ã¹ã«ã€ããŠã¯ãæŽçããããšæããŸãã ããããããã»ã¹ã¯ã©ãã§ããïŒ ããã§ãããã¹ãŠãç°¡åã§ãã å€æ°ã®ã·ã¹ãã ãŠãŒãã£ãªãã£ã
-n
ãªãã·ã§ã³ãæäŸããŸããããã¯ããªã¢ãŒããã¹ãã§äœæ¥ãããããªã¢ãŒããã¹ãããæ å ±ãåéããå¿ èŠãããããšã瀺ããŸãã ããšãã°ã次ã®ãããªã³ãã³ãã©ã€ã³åŒæ°ã䜿çšããŠãå®è¡äžã®ããã»ã¹ã®ãªã¹ããååŸã§ããŸãã
pidin -n zvezda arg
äžéšã®ãŠãŒãã£ãªãã£ãŸãã¯ããã°ã©ã ã
-n
ãªãã·ã§ã³ããµããŒãããŠããªãå Žåãæšæºã®ãŠãŒãã£ãªãã£ã
-n
ãŸããããã¯ãããšãã°æ¬¡ã®ããã«å¥ã®ããŒãã§ã¢ããªã±ãŒã·ã§ã³ãå®è¡ããããã«èšèšãããŠããŸãã
on -f zvezda ls
ãã®å Žåã
ls
ãŠãŒãã£ãªãã£ã¯zvezdaãã¹ãã§å®è¡ããããŠãŒãã£ãªãã£ã®åºåã¯çŸåšã®ã¿ãŒããã«ã«è¡šç€ºãããŸãã
åæ
çãªäœè«ãšããŠã
å®éã
ãŠãŒãã£ãªãã£ã¯ãå®è¡äžã®ããã»ã¹ã®ãã©ã¡ãŒã¿ãŒã管çããããã®è±å¯ãªãªãã·ã§ã³ãæäŸããŸãã ãªã¢ãŒããã¹ãã§ããã»ã¹ãéå§ã§ããã ãã§ãªããåªå 床ã¬ãã«ã®å€æŽããã£ã·ããªã³ã®ãã£ã¹ããããå¥ã®ãŠãŒã¶ãŒããã®ããã»ã¹ã®éå§ãããã«ç¹å®ã®ããã»ããµã³ã¢ãžã®ããã»ã¹ã®ãã€ã³ããå¯èœã§ãã 詳现ã«ã€ããŠã¯ããŠãŒãã£ãªãã£ã®ãã«ããã芧ãã ããã
on
ãŠãŒãã£ãªãã£ã¯ãå®è¡äžã®ããã»ã¹ã®ãã©ã¡ãŒã¿ãŒã管çããããã®è±å¯ãªãªãã·ã§ã³ãæäŸããŸãã ãªã¢ãŒããã¹ãã§ããã»ã¹ãéå§ã§ããã ãã§ãªããåªå 床ã¬ãã«ã®å€æŽããã£ã·ããªã³ã®ãã£ã¹ããããå¥ã®ãŠãŒã¶ãŒããã®ããã»ã¹ã®éå§ãããã«ç¹å®ã®ããã»ããµã³ã¢ãžã®ããã»ã¹ã®ãã€ã³ããå¯èœã§ãã 詳现ã«ã€ããŠã¯ããŠãŒãã£ãªãã£ã®ãã«ããã芧ãã ããã
ããã»ã¹ã®åæ¢ãç°¡åã§ã
slay
ãŠãŒãã£ãªãã£ã¯
-n
ãªãã·ã§ã³ããµããŒãããŠããŸãã äŸïŒ
slay -n zvezda io-usb
åæ§ã«ã
slay
ã䜿çšãããšãSIGTERMã ãã§ãªããä»ã®ä¿¡å·ãéä¿¡ã§ããŸãã
Qnetã¯ããã°ã©ããŒã®èŠ³ç¹ããã©ã®ããã«æ©èœããŸããïŒ
åã®ã»ã¯ã·ã§ã³ã§ã¯ãRTOSãŠãŒã¶ãŒã®èŠ³ç¹ããQnetãæ€èšããŸããã ã»ãšãã©ã®å ŽåãQnetããµããŒãããããã«ãœãããŠã§ã¢éçºããå¿ èŠãããŸããã ããã¯æ¬åœã§ããïŒ ã€ãŸã ãããã¯ãŒã¯ã¢ããªã±ãŒã·ã§ã³ãäœæããã«ã¯ãç¹å¥ãªãã¬ãŒã ã¯ãŒã¯ãã©ã€ãã©ãªã䜿çšããå¿ èŠã¯ãããŸãããïŒ ã¯ããå¿ é ã§ã¯ãããŸããã POSIXã䜿çšããå Žåãéãã«æ°ä»ãããšãããããŸããã ããããæ ¹æ ããªãããã«ããããã«ãå°ããªããã°ã©ã ã®ã³ãŒããæäŸããŸããããã¯ãäŸãšããŠæååããã¡ã€ã«ã«ä¿åããŸãïŒãªã¢ãŒããã¹ããå«ââãïŒã
#include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <fcntl.h> int main(int argc, char *argv[]) { int fd; char str[] = "This is a string.\n"; if ( argc < 2 ) { printf("Please specify file name.\n"); exit(1); } if ( (fd = open(argv[1], O_RDWR|O_CREAT, 0644)) < 0 ) { perror("open()"); exit(1); } write(fd, str, sizeof(str)-1); close(fd); return 0; }
ãã®ã³ãŒãã¯Qnetãšäºææ§ããããŸãã çµå±ã®ãšãããè¡ã
/tmp/1.txt
ä¿åããããã¡ã€ã«ãš
/tmp/1.txt
ä¿åããããã¡ã€ã«ã«éãã¯ãããŸããã ããã€ã¹ã«ã€ããŠãåãããšãèšããŸãããããã°ã©ãåãã®2ã€ã®ã³ãŒããã©ã°ã¡ã³ãã¯åäžã§ãïŒéãã¯ãã¡ã€ã«åã®ã¿ã§ãïŒã
fd = open("/dev/ser1", O_RDWR);
ãããŠ
fd = open("/net/zvezda/dev/ser1", O_RDWR);
ãããã¯ãŒã¯ã§ã®äœæ¥ã®ãã®åçŽããå¯èœã«ãããã®ã¯äœã§ããïŒ
open()
ãªã©ã®POSIXåŒã³åºãã¯ã ã¡ãã»ãŒãžã³ã°ãå¶åŸ¡ããäžé£ã®äœã¬ãã«ã®ãã€ã¯ãã«ãŒãã«åŒã³åºããçæããŸãïŒ
ConnectAttach()
ã
MsgSend()
ãªã©ã ãããã¯ãŒã¯ã«å¿ èŠãªããã°ã©ã ã³ãŒãã¯ãããŒã«ã«ã§äœ¿çšããããã®ãšåãã§ãã éãã¯ãã¹åã®ã¿ã§ãããããã¯ãŒã¯æäœã®å Žåããã¹åã«ã¯ãã¹ãåãå«ãŸããŸãã ãã¹ãåã®ä»ãããã¬ãã£ãã¯ã¹ã¯ãã¹ãèšè¿°åã«å€æãããåŸã§
ConnectAttach()
ãžã®äœã¬ãã«ã®åŒã³åºãã§äœ¿çšãããŸãã ãããã¯ãŒã¯å ã®åããŒãã«ã¯ãç¬èªã®èšè¿°åããããŸãã ãã¡ã€ã«ã·ã¹ãã ãã¹ã®åå空éã¯ãèšè¿°åã®æ€çŽ¢ã«äœ¿çšãããŸãã 1å°ã®ãã·ã³ã®å Žåãæ€çŽ¢çµæã¯ããŒãèšè¿°åãããã»ã¹èå¥åãããã³ãã£ãã«èå¥åã«ãªããŸãã Qnetãããã¯ãŒã¯ã®å Žåãçµæã¯åãã«ãªããããŒãèšè¿°åã®ã¿ããŒã以å€ã«ãªããŸãïŒã€ãŸããND_LOCAL_NODEãšçãããªããããã¯ãªã¢ãŒãæ¥ç¶ã瀺ããŸãïŒã ãã ãããããã®åŒã³åºãã¯ãã¹ãŠé衚瀺ã§ãããåã«
open()
䜿çšããå Žåã¯ããããåŠçããå¿ èŠã¯ãããŸããã
åçŽãªopen()?
é¢æ°ã®èåŸã«é ãããŠãããã®ã¯äœopen()?
node1
ã¢ããªã±ãŒã·ã§ã³ã
node2
ã·ãªã¢ã«ããŒã
/dev/ser1
ã䜿çšããå¿ èŠãããç¶æ³ãèã
node2
ã å³
/net/node2/dev/ser1
2ã¯ãã¢ããªã±ãŒã·ã§ã³ã
/net/node2/dev/ser1
ãšããååã§
open()
é¢æ°ãåŒã³åºãããšãã«å®è¡ãããæäœã瀺ããŠã
/net/node2/dev/ser1
ã
å³ 2. Qnetãããã¯ãŒã¯ãä»ããã¡ãã»ãŒãžã³ã°ã
- ã¢ããªã±ãŒã·ã§ã³ã¯ããã¹å
/net/node2/dev/ser1
ãžã®èš±å¯ãæ±ããã¡ãã»ãŒãžãããŒã«ã«ããã»ã¹ãããŒãžã£ãŒã«éä¿¡ããŸãã ãªããªãlsm-qnet.so
ã¯/net
lsm-qnet.so
æ åœããããã»ã¹ãããŒãžã£ãŒã¯ãã¢ããªã±ãŒã·ã§ã³ãããŒã«ã«io-pkt
ãããã¯ãŒã¯ç®¡çè ã«é£çµ¡ããå¿ èŠãããããšã瀺ããªãã€ã¬ã¯ãã¡ãã»ãŒãžãè¿ããŸãã - ã¢ããªã±ãŒã·ã§ã³ã¯ããã¹åã解決ããããã®åãèŠæ±ãšãšãã«ãããŒã«ã«
io-pkt
ãããã¯ãŒã¯ç®¡çè ã«ã¡ãã»ãŒãžãéä¿¡ããŸãã ããŒã«ã«ãããã¯ãŒã¯ç®¡çè ã¯ãnode2
ããŒããããŒãžã£ãŒããã»ã¹ã®ããŒãèšè¿°åãããã»ã¹èå¥åãããã³ãã£ãã«èå¥åã瀺ããªãã€ã¬ã¯ãã¡ãã»ãŒãžãè¿ããŸãã - ã¢ããªã±ãŒã·ã§ã³ã¯ã
node2
ããŒãããã»ã¹ãããŒãžã£ãŒãšã®æ¥ç¶ãäœæãããã¹åã®è§£æ±ºèŠæ±ãå床éä¿¡ããŸããnode2
ã®ããã»ã¹ãããŒãžã£ãŒã¯ãããŒãèšè¿°åãããã»ã¹IDãããã³èªèº«ã®ããŒãïŒnode2
ïŒã®ã·ãªã¢ã«ããŒããã©ã€ããŒã®ãã£ãã«èå¥åã瀺ãå¥ã®ãªãã€ã¬ã¯ãã¡ãã»ãŒãžãè¿ããŸãã - ã¢ããªã±ãŒã·ã§ã³ã¯ã
node2
ã·ãªã¢ã«ããŒããã©ã€ããŒãšã®æ¥ç¶ãäœæããããã«ã¡ãã»ãŒãžã³ã°ã«äœ¿çšã§ããæ¥ç¶èå¥åãåãåãnode2
ïŒããšãã°ãread()
ãwrite()
ãããã³ä»ã®POSIXé¢æ°ãåŒã³åºããããšãïŒã
ãã®ãã¹ãŠã®æ¢æ±ã®åŸãåä¿¡ããæ¥ç¶èå¥åã«ããã¡ãã»ãŒãžã®äº€æã¯ãããŒã«ã«äº€æã®å ŽåãšãŸã£ããåãæ¹æ³ã§è¡ãããŸãã ãã以éã®ãã¹ãŠã®ã¡ãã»ãŒãžã³ã°æäœã¯ã
node1
ã®ã¢ããªã±ãŒã·ã§ã³ãš
node1
ã®ã·ãªã¢ã«ããŒããã©ã€ããŒïŒãŸããéåžžã®QNXã¢ããªã±ãŒã·ã§ã³ïŒã®éã§çŽæ¥å®è¡ãããããšãéèŠã§ãã
POSIXé¢æ°
open()
ã䜿çšããããã°ã©ããŒã«ãšã£ãŠããããã®äœã¬ãã«ã®åŒã³åºãã¯ãã¹ãŠé ãããŠããããšãããäžåºŠåŒ·èª¿ããŸãã
open()
ãåŒã³åºããšããã¡ã€ã«èšè¿°åãŸãã¯ãšã©ãŒã³ãŒããè¿ãããŸãã
æè¡çãªäœè«ãšããŠã
åã¹ãããã§ååã解決ãããšãã解決ãããååã³ã³ããŒãã³ãã¯ãªã¯ãšã¹ãããèªåçã«åé€ãããŸãã äžèšã®äŸã§ã¯ãã¹ããã2ã§ãããŒã«ã«ãããã¯ãŒã¯ç®¡çè
ãžã®èŠæ±ã«ã¯
ã®ã¿ãå«ãŸããŠã
ã ã¹ããã3ã§ãååã«ã¯
ã®ã¿ãå«ãŸããŸãã ã¹ããã4-
ã®ã¿ã
node2/dev/ser1
ã®ã¿ãå«ãŸããŠã
node2/dev/ser1
ã ã¹ããã3ã§ãååã«ã¯
dev/ser1
ã®ã¿ãå«ãŸããŸãã ã¹ããã4-
ser1
ã®ã¿ã
ãµãŒãã¹å質ããªã·ãŒ
Qnetãããã³ã«ã¯ãã«ããã£ãã«äŒéããµããŒãããŠããŸãã è€æ°ã®ãã£ãã«ã䜿çšãããšãã«åäœã¢ãŒããéžæããã«ã¯ããµãŒãã¹å質ïŒQoSïŒããªã·ãŒãé©çšãããŸãã Qnetãããã¯ãŒã¯ã§ã¯ãQoSã¯åºæ¬çã«äŒéåªäœãéžæããŸãã ãã ããã·ã¹ãã ã«ãããã¯ãŒã¯ã€ã³ã¿ãŒãã§ã€ã¹ã1ã€ãããªãå ŽåãQoSã¯æ©èœããŸããã 次ã®ãµãŒãã¹å質ããªã·ãŒããµããŒããããŠããŸãã
- loadbalance-Qnetãããã³ã«ã¯å©çšå¯èœãªéä¿¡ãã£ãã«ã䜿çšãããããã®éã§ããŒã¿è»¢éãåæ£ã§ããŸãã ãã®ããªã·ãŒã¯ããã©ã«ãã§äœ¿çšãããŸãã ãã®ã¢ãŒãã§ã¯ãããŒãéã®ã¹ã«ãŒãããã¯ã䜿çšå¯èœãªãã¹ãŠã®ãã£ãã«ã®ã¹ã«ãŒãããã®åèšã«çãããªããŸãã ãã£ãã«ã®1ã€ãå£ãããšãQnetã¯ä»ã®äœ¿çšå¯èœãªãã£ãã«ã䜿çšããããã«èªåçã«åãæ¿ãããŸãã ãµãŒãã¹ãã±ããã¯é害ãçºçãããã£ãã«ã«èªåçã«éä¿¡ãããéä¿¡ãå埩ãããšãQnetã¯ãã®ãã£ãã«ãåã³äœ¿çšããŸãã
- åªå -æå®ããã1ã€ã®éä¿¡ãã£ãã«ã®ã¿ã䜿çšãããæ®ãã¯ã¡ã€ã³ã®éä¿¡ãã£ãã«ã倱æãããŸã§ç¡èŠãããŸãã ã¡ã€ã³éä¿¡ãã£ãã«ã«é害ãçºçãããšãQnetã¯äœ¿çšå¯èœãªãã¹ãŠã®ãã£ãã«ã䜿çšããŠè² è·åæ£ã¢ãŒãã«åãæ¿ãããŸãã ã¡ã€ã³ãã£ãã«ã埩å ãããšãQnetã¯åªå ã¢ãŒãã«åãæ¿ãããŸãã
- æä»ç -æå®ããã1ã€ã®éä¿¡ãã£ãã«ã®ã¿ã䜿çšãããã¡ã€ã³ã®ãã£ãã«ã倱æããŠãæ®ãã®ãã£ãã«ã¯äœ¿çšãããŸããã
ãã«ãæåïŒãïŒã§å§ãŸããã¹å修食åã䜿çšããŠããµãŒãã¹å質ããªã·ãŒãèšå®ããŸãã ããšãã°ã
en0
ã€ã³ã¿ãŒãã§ã€ã¹ã§QoS å°çšããªã·ãŒã䜿çšããŠzvezdaãã¹ãã®ã·ãªã¢ã«ããŒãã«ã¢ã¯ã»ã¹ããå Žåãååã¯æ¬¡ã®ããã«ãªããŸãã
/net/zvezda~exclusive:en0/dev/ser1
Qnetã䜿çšããå Žå
ãããã³ã«ã®éžæã¯å€ãã®èŠå ã«äŸåããŸãã Qnetãããã³ã«ã¯ãQNX Neutrino RTOSãå®è¡ããåããã€ãé ã®ä¿¡é Œã§ããã³ã³ãã¥ãŒã¿ãŒã®ãããã¯ãŒã¯ã察象ãšããŠããŸãã Qnetã¯ãªã¯ãšã¹ããèªèšŒããŸããã ã¢ã¯ã»ã¹æš©ã¯ãéåžžã®ãŠãŒã¶ãŒèš±å¯ãšãã¡ã€ã«ã°ã«ãŒãã«ãã£ãŠä¿è·ãããŸãã Qnetãããã³ã«ãæ¥ç¶ã確ç«ãããããã³ã«ã§ããããããã¯ãŒã¯ãšã©ãŒã¡ãã»ãŒãžãã¯ã©ã€ã¢ã³ãããã»ã¹ã«éä¿¡ãããŸãã
ç°ãªããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ãæèŒããã³ã³ãã¥ãŒã¿ãŒããããã¯ãŒã¯ã§åäœããå ŽåããŸãã¯ãããã¯ãŒã¯ã®ä¿¡é ŒåºŠãé«ããªãå Žåã¯ãQNXã§ãåäœããä»ã®ãããã³ã«ãããšãã°TCP / IPãç¹ã«FTPãNFSãTelnetãSSHãªã©ã®äœ¿çšãæ€èšãã䟡å€ããããŸãã
ãšãããŒã°ã®ä»£ããã«
ãã¡ããããã®ããŒãã§ã¯ããã¹ãŠã®Qnetæ©èœãšæ©èœãèæ ®ãããŠããããã§ã¯ãããŸãããããããã³ã«æ©èœã®äžè¬çãªèª¬æãèšèŒãããŠããŸãã QnetãŸãã¯QNXãã¯ãããžãŒå šè¬ã«èå³ãããå Žåã¯ãQNX Neutrinoã®ã·ã¹ãã ã¢ãŒããã¯ãã£ã®ãããã®ãããã¯ããã³ãã®ä»ã®ãããã¯ã«é¢ããè³æãåç §ããŠãã ããã ããã¥ã¡ã³ãã¯ãWebãµã€ãwww.qnx.com ïŒè±èªïŒããé»å圢åŒã§å ¥æã§ããŸããäžéšã®ç¿»èš³ã¯ãWebãµã€ãwww.kpda.ruããå ¥æã§ããŸãã å°å·ç©ã«ã¯ãã·ã¢èªã®ç¿»èš³ããããŸãã
ãªã¢ã«ã¿ã€ã ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã QNX Neutrino 6.5.0ã·ã¹ãã ã¢ãŒããã¯ãã£ã ISBN 978-5-9775-3350-8
ãªã¢ã«ã¿ã€ã ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã QNX Neutrino 6.5.0ãŠãŒã¶ãŒã¬ã€ãã ISBN 978-5-9775-3351-5