ã¯ããã«
ãã®åºçç©ã§ã¯ãgbaunixã«ã€ããŠã話ããŸããããã¯ã人æ°ã®ããïŒåºçæã2004幎é -ãããTranslãïŒããŒã¿ãã«ã³ã³ãœãŒã«ã§ã·ãã¥ã¬ãŒã¿ã§å€ä»£ããŒãžã§ã³ã®UNIXãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ãç«ã¡äžãã楜ããå®éšã§ãã ã€ãŸãã任倩å ã²ãŒã ããŒã€ã¢ããã³ã¹ã®UNIX 5çïŒ1974幎ã39幎åã«ãªãªãŒã¹ïŒã§ãã ããã¯ãGameboyã®èªäœéçºè ãOSã«ç¹åããITåŠçããšãã¥ã¬ãŒã¿ãŒãŸãã¯ã³ã³ãã€ã©ãŒãUnixãªã¿ã¯ã«ãšã£ãŠèå³æ·±ããããããŸããã

任倩å ã¯1889幎ããã²ãŒã åžå Žã«åå ¥ããŠããŸãïŒåæïŒïŒ ã²ãŒã ããŒã€ã¯ãä»æ¥ãŸã§éåžžã«æåè£ã«è²©å£²ãããŠããããŒã¿ãã«ã³ã³ãœãŒã«ã®å šã©ã€ã³ã®ãã©ã³ãã§ãã 1989幎ã®ãªãªãŒã¹ä»¥æ¥ã1å7500äžå°ã販売ãããŸããã ãã®èšäºã§ã¯ãGame Boy Advanceãç¥ããŠGBAãããã³å¯Ÿå¿ããGBA SPã«ã€ããŠèª¬æããŸãã
éïŒ
- 16.78 MHzã§ã¯ããã¯ããã32ãããARMããã»ããµïŒRISCïŒ
- 16.78 MHzã§ã¯ããã¯ããã32ãããARMããã»ããµïŒRISCïŒ
- Z80 8ãããããã»ããµïŒCISCïŒãåšæ³¢æ°4.2ãŸãã¯8.4 MHzã å€ãã²ãŒã ããŒã€ãšã®äºææ§ã®ããã«è¿œå ãããCPUãæèŒãããŠããŸãã
- 4ã€ã®16ãããã¿ã€ããŒ
- 4ãã£ã³ãã«DMA
- ã«ã©ãŒTFTã¹ã¯ãªãŒã³ã解å床240x160
- ããããã©ã³ãä»ããã¹ãã¬ãªãµãŠã³ã
- 10åã®ãã¿ã³
- ã·ãªã¢ã«ããŒã
- GamePakã«ãŒããªããžã®ã€ã³ã¿ãŒãã§ãŒã¹
ã³ã³ãœãŒã«ã«ã¯ããã€ãã®ã¡ã¢ãªãããã¯ããããŸãã
- 16 KB BIOS ROM
- ããŒãã«ã¯ãã ä»ãããã256 KBã®å€éšRAMïŒEWRAMïŒ
- CPUãããïŒIWRAMïŒäžã®32 KBã®å éšRAM
- èæ¯ããã³ã¹ãã©ã€ããã¬ããçšã®1 KB RAM
- 96 KBãããªRAM
- ãªããžã§ã¯ãå±æ§çšã®1 KB RAM
- æ倧32 MBã®ROMã«ãŒããªããž
- æ倧64 KBã®SRAMã«ãŒããªããžããªãã·ã§ã³
ã«ãŒããªããžROMã«ã¯ãã³ã³ãœãŒã«ã®ã¢ãã¬ã¹ã¹ããŒã¹ã«2ã€ã®è¿œå ãããã³ã°ãããããšã«æ³šæããŠãã ããã ããã«ãã«ãŒããªããžã«ã¯ãµã€ãºãã¿ã€ãã³ã°ãç°ãªãè€æ°ã®ã¡ã¢ãªãã³ã¯ãå«ãŸããŠããå ŽåããããŸãã
GBAã¯ãéåžžã®ã«ãŒããªããžãæžãæãå¯èœãªãã©ãã·ã¥ã«ãŒããªããžããã¹ã¿ãŒã¢ãŒãã®å¥ã®GBAããŸãã¯ã±ãŒãã«ãä»ããŠã³ã³ãã¥ãŒã¿ãŒãããããŒãã§ããŸãã ãã®æ©èœã¯BIOSã§ä¿è·ãããŠããŸãã
ã³ã³ãœãŒã«ããŒããŠã§ã¢ã¯ãäž»ã«ååã«ææžåãããã¢ãã¬ã¹ã¹ããŒã¹ããã¢ã¯ã»ã¹ã§ããŸãã ããŸããŸãªI / Oã¬ãžã¹ã¿ãã¡ã¢ãªã¢ãã¬ã¹ã«ããããããŸãã ããã«å ããŠãBIOSã«ã¯ãœãããŠã§ã¢å²ã蟌ã¿ãä»ããŠå©çšã§ããå€ãã®æ©èœãå«ãŸããŠããŸãã
ARMã¢ãŒããã¯ãã£ã«é¢ããæè©ã®äœè«
任倩å ã¯ã³ã³ãœãŒã«åžå Žã®ãªãŒããŒã§ãããARMã¯RISCããã»ããµåžå Žã®ãªãŒããŒã§ãã çŸåšãAWPã¯ã»ãšãã©ãã¹ãŠã®é»åæ©åšã«ååšããŠããŸãã Intelã¯ãã¹ã¯ããããæäœããŸããã¯ãã ããããPCã®ããã»ããµã¯ãç·çç£éã®ããäžéšãå ããŠããŸãã 2003幎ã«ã¯ãAWPã§7å8200äžå°ã®ããã€ã¹ã補é ãããŸããã äžè¬ã«ããã®å°åã®ãã®ã¢ãŒããã¯ãã£ã®ã·ã§ã¢ã¯75ïŒ ã§ãã
ã»ãšãã©ã®å ŽåãAWPã¯åãæã§ãçµã¿èŸŒã¿ãããçç£çãããå®ããããäœèèªãããRISCããšããåèªãšãšãã«äœ¿çšãããŸãã AWPã¯ãIntelãAppleãSamsungãªã©ã®å€§èŠæš¡ããã»ããµãå«ãããã»ããµã®è£œé å ã«ã¢ãŒããã¯ãã£ã®ã©ã€ã»ã³ã¹ãçŽæ¥äŸäžããŸãã
æåã®ã¯ãŒã¯ã¹ããŒã·ã§ã³ã¯ã80幎代åã°ã«Acorn Computers Limitedã§éçºãããŸããã ãã®åŸããAcorn RISC MachineããšããŠè§£èªãããŸããã AWPã¢ãŒããã¯ãã£ã®æåã®ããŒãžã§ã³ã§ããARMv1ã¯26ãããã¢ãã¬ãã·ã³ã°ããµããŒãããŠãããéåžžã«äœéã§ããã ãã®ã¢ãŒããã¯ãã£ã®æåã®ããã»ããµã§ããARM1ã¯ã空è»ã®ãã€ã¯ãã³ã³ãã¥ãŒã¿ãšã¢ã«ãã¡ãã¹ã¯ãŒã¯ã¹ããŒã·ã§ã³ãããã¿ã€ãã®åšèŸºããã»ããµã§ããã ãããŠãããã¯æåã®RISCã¢ãŒããã¯ãã£ããã»ããµã®1ã€ã§ããã äž»ãªæ©èœïŒé 延åå²ãã¬ãžã¹ã¿ãŠã£ã³ããŠãååœä»€ã¯1ã¯ããã¯ãµã€ã¯ã«ã§å®è¡ãããŸãã
Appleã¯90幎代åæã«AWPã䜿çšããããšããŸããã Acornãšå ±åã§ã圌ãã¯æ°äŒç€ŸAdvanced RISC MachinesãLimitedãç«ã¡äžããŸããã å¥ã®å ±ç¯è ã¯VLSIãã¯ãããžãŒã§ããã ç¥èªãå€æŽãããŸããã æ°ããããã»ããµã¯ãARM6ãã¢ãŒããã¯ãã£-ARMv3ãšåŒã°ããŠããŸããã å®å šã«32ãããã®ã¢ãã¬ã¹æå®ããããŸãã ãã®ããã»ããµã¯Apple Newtonã§äœ¿çšãããŠããŸããã
Gameboyã¯ãARMv4TããŒãžã§ã³ã®ã¢ãŒããã¯ãã£ã§ããARM7TDMIããã»ããµã䜿çšããŸãã
ARM7TDMIã¯ãæ©èœããããã«å¶éãããŠããäžè¬çãªçµã¿èŸŒã¿32ãããããã»ããµã§ãã ãã£ãã·ã¥ãšMMUã¯ãããŸããã æå®ã¯æ¬¡ã®ããã«è§£èªãããŸãã
ARM7ããã»ããµ
16ãããT humbåœä»€ã»ããããµããŒã
ããŒããŠã§ã¢ã§çŽæ¥ãããã°ããµããŒã
Mãã§ããã³ã°ã§32ãããã®çµã¿èŸŒã¿ãããã¯ããããçµæã¯64ãããã§ã
ãããã°çšã®çµã¿èŸŒã¿I CEããããŸã
ARM7TDMIã³ã¢ã«ã¯ãããŒã¿ãšåœä»€çšã®32ããããã¹ã1ã€ãããŸãã ããŒã¿ã®ãµã€ãºã¯8ã16ã32ãããã§ãã ã¡ã¢ãªã«ã¢ã¯ã»ã¹ã§ããã®ã¯ãããŠã³ããŒããä¿åãå ±æã®æ瀺ã®ã¿ã§ãã 31åã®32ãããæ±çšã¬ãžã¹ã¿ã6åã®ã¹ããŒã¿ã¹ã¬ãžã¹ã¿ãã·ããã¬ãžã¹ã¿ãç®è¡ããã³ä¹ç®ãããã¯ããããŸãã ãã¹ãŠã®ã¬ãžã¹ã¿ãåæã«äœ¿çšã§ããããã§ã¯ãããŸããã ããšãã°ãARMã¢ãŒãã§ã¯ã16åã®æ±çšã¬ãžã¹ã¿ãš1åãŸãã¯2åã®ã¹ããŒã¿ã¹ã¬ãžã¹ã¿ã䜿çšã§ããŸãã 7ã€ã®ããã»ããµã¢ãŒãããããŸããããã°ã©ã ãå®è¡ããããã®éåžžã®ã¢ãŒããšã6ã€ã®ç¹å¥ãªã¢ãŒãã§ãã ãããã¯ãé«éå²ã蟌ã¿ãå²ã蟌ã¿ãç£èŠããã°ã©ã ãåæ¢ãæªå®çŸ©ç¶æ ãããã³ã·ã¹ãã ã¢ãŒãã§ãã ARMãšThumbã®2ã€ã®åœä»€ã»ããããµããŒããããŠããŸãã
Gameboyã¯4ã€ã®DMAãã£ãã«ããµããŒãããŠããŸãã ããã»ããµã«ã¯ãéåžžã®IRQãšé«éFIQã®2çš®é¡ã®å²ã蟌ã¿ããããŸãããã³ã³ãœãŒã«ã§ã¯åŸæ¥ã®å²ã蟌ã¿ã®ã¿ã䜿çšãããŸãã
ARM7ã«ã¯ãåçŽãª3段éã®ãã€ãã©ã€ã³ããããŸãã
ã³ãã³ãã¯ã¡ã¢ãªããååŸããããã¥ãŒã«å ¥ããããŸã
ãã³ãŒããããã³ãã³ã
ã³ãã³ãã¯å®è¡äžã§ãã ãã®å Žåãã¬ãžã¹ã¿ããã®èªã¿åããçµæã®èšç®ãããã³ã¬ãžã¹ã¿ãžã®æžã蟌ã¿ãè¡ãããŸãã
ãããã£ãŠããã€ã§ã1ã€ã®ã³ãã³ããå®è¡ããã次ã®ã³ãã³ãããã³ãŒãããã1ã€ã®ã³ãã³ããååŸãããŸãã
RISCããã»ããµã®æ¯èŒçäžå©ãªç¹ã¯ãã³ãŒããæ¯èŒç倧ããããšã§ãã ããã«ãããããã°ã©ã ã®ãµã€ãºã倧ãããªãããã£ãã·ã¥å¹çã®æ倱ãéå°ãªã¡ã¢ãªãã©ãã£ãã¯ãããã³é»åæ¶è²»ã«ã€ãªãããŸãã çµã¿èŸŒã¿ã¢ããªã±ãŒã·ã§ã³ã®å Žåãããã¯ç¹ã«æªãã§ãã ã³ãŒããå§çž®ããããã«ãThumbã¢ãŒããã¯ãã£ãéçºããŸããã
Thumbã¯ã16ãããã«å§çž®ããã32ãããARMã³ãã³ãã®ã·ã¹ãã ã§ãã æãäžè¬çãªäžé£ã®åœä»€ããµããŒããããŠããŸãã åã32ãããã®ã¬ãžã¹ã¿ã§åäœããŸãã Thumb察å¿ããã»ããµã®ãã€ãã©ã€ã³ã«ã¯ãéåžžã®ARMåœä»€ã«å€æãããã³ãŒããŒãè£ åãããŠããŸãã éãã¯æ¬¡ã®ãããªãã®ã§ãã
äžè¬çã«äœ¿çšãããARMã³ãã³ããšThumbã³ãã³ãã®çµã¿åããã å®è¡ãããã³ãã³ãã®ã¿ã€ãã¯ãç¹å¥ãªãã©ã°ã§ç€ºãããŸãã Gameboyã«ã¯ããããäžã«32 KBã®é«éã¡ã¢ãªããããŸãã éåžžãé床ãéèŠãªã³ãŒãã¯ããããå®è¡ãããŸãã ä»ã®ãã¹ãŠã¯ãThumbã§äœæããäœéã®ã«ãŒããªããžã¡ã¢ãªããå®è¡ããã®ã«é©ããŠããŸãã
habrahabr.ru/post/92494-ARMã«é¢ããäžè¬çãªåèè³æ ã -çŽ perevã
è
任倩å ã¯ã³ã³ãœãŒã«åžå Žã®ãªãŒããŒã§ãããARMã¯RISCããã»ããµåžå Žã®ãªãŒããŒã§ãã çŸåšãAWPã¯ã»ãšãã©ãã¹ãŠã®é»åæ©åšã«ååšããŠããŸãã Intelã¯ãã¹ã¯ããããæäœããŸããã¯ãã ããããPCã®ããã»ããµã¯ãç·çç£éã®ããäžéšãå ããŠããŸãã 2003幎ã«ã¯ãAWPã§7å8200äžå°ã®ããã€ã¹ã補é ãããŸããã äžè¬ã«ããã®å°åã®ãã®ã¢ãŒããã¯ãã£ã®ã·ã§ã¢ã¯75ïŒ ã§ãã
ã»ãšãã©ã®å ŽåãAWPã¯åãæã§ãçµã¿èŸŒã¿ãããçç£çãããå®ããããäœèèªãããRISCããšããåèªãšãšãã«äœ¿çšãããŸãã AWPã¯ãIntelãAppleãSamsungãªã©ã®å€§èŠæš¡ããã»ããµãå«ãããã»ããµã®è£œé å ã«ã¢ãŒããã¯ãã£ã®ã©ã€ã»ã³ã¹ãçŽæ¥äŸäžããŸãã
æåã®ã¯ãŒã¯ã¹ããŒã·ã§ã³ã¯ã80幎代åã°ã«Acorn Computers Limitedã§éçºãããŸããã ãã®åŸããAcorn RISC MachineããšããŠè§£èªãããŸããã AWPã¢ãŒããã¯ãã£ã®æåã®ããŒãžã§ã³ã§ããARMv1ã¯26ãããã¢ãã¬ãã·ã³ã°ããµããŒãããŠãããéåžžã«äœéã§ããã ãã®ã¢ãŒããã¯ãã£ã®æåã®ããã»ããµã§ããARM1ã¯ã空è»ã®ãã€ã¯ãã³ã³ãã¥ãŒã¿ãšã¢ã«ãã¡ãã¹ã¯ãŒã¯ã¹ããŒã·ã§ã³ãããã¿ã€ãã®åšèŸºããã»ããµã§ããã ãããŠãããã¯æåã®RISCã¢ãŒããã¯ãã£ããã»ããµã®1ã€ã§ããã äž»ãªæ©èœïŒé 延åå²ãã¬ãžã¹ã¿ãŠã£ã³ããŠãååœä»€ã¯1ã¯ããã¯ãµã€ã¯ã«ã§å®è¡ãããŸãã
Appleã¯90幎代åæã«AWPã䜿çšããããšããŸããã Acornãšå ±åã§ã圌ãã¯æ°äŒç€ŸAdvanced RISC MachinesãLimitedãç«ã¡äžããŸããã å¥ã®å ±ç¯è ã¯VLSIãã¯ãããžãŒã§ããã ç¥èªãå€æŽãããŸããã æ°ããããã»ããµã¯ãARM6ãã¢ãŒããã¯ãã£-ARMv3ãšåŒã°ããŠããŸããã å®å šã«32ãããã®ã¢ãã¬ã¹æå®ããããŸãã ãã®ããã»ããµã¯Apple Newtonã§äœ¿çšãããŠããŸããã
Gameboyã¯ãARMv4TããŒãžã§ã³ã®ã¢ãŒããã¯ãã£ã§ããARM7TDMIããã»ããµã䜿çšããŸãã
ã²ãŒã ããŒã€ã®ARM
ARM7TDMIã¯ãæ©èœããããã«å¶éãããŠããäžè¬çãªçµã¿èŸŒã¿32ãããããã»ããµã§ãã ãã£ãã·ã¥ãšMMUã¯ãããŸããã æå®ã¯æ¬¡ã®ããã«è§£èªãããŸãã
ARM7ããã»ããµ
16ãããT humbåœä»€ã»ããããµããŒã
ããŒããŠã§ã¢ã§çŽæ¥ãããã°ããµããŒã
Mãã§ããã³ã°ã§32ãããã®çµã¿èŸŒã¿ãããã¯ããããçµæã¯64ãããã§ã
ãããã°çšã®çµã¿èŸŒã¿I CEããããŸã
ARM7TDMIã³ã¢ã«ã¯ãããŒã¿ãšåœä»€çšã®32ããããã¹ã1ã€ãããŸãã ããŒã¿ã®ãµã€ãºã¯8ã16ã32ãããã§ãã ã¡ã¢ãªã«ã¢ã¯ã»ã¹ã§ããã®ã¯ãããŠã³ããŒããä¿åãå ±æã®æ瀺ã®ã¿ã§ãã 31åã®32ãããæ±çšã¬ãžã¹ã¿ã6åã®ã¹ããŒã¿ã¹ã¬ãžã¹ã¿ãã·ããã¬ãžã¹ã¿ãç®è¡ããã³ä¹ç®ãããã¯ããããŸãã ãã¹ãŠã®ã¬ãžã¹ã¿ãåæã«äœ¿çšã§ããããã§ã¯ãããŸããã ããšãã°ãARMã¢ãŒãã§ã¯ã16åã®æ±çšã¬ãžã¹ã¿ãš1åãŸãã¯2åã®ã¹ããŒã¿ã¹ã¬ãžã¹ã¿ã䜿çšã§ããŸãã 7ã€ã®ããã»ããµã¢ãŒãããããŸããããã°ã©ã ãå®è¡ããããã®éåžžã®ã¢ãŒããšã6ã€ã®ç¹å¥ãªã¢ãŒãã§ãã ãããã¯ãé«éå²ã蟌ã¿ãå²ã蟌ã¿ãç£èŠããã°ã©ã ãåæ¢ãæªå®çŸ©ç¶æ ãããã³ã·ã¹ãã ã¢ãŒãã§ãã ARMãšThumbã®2ã€ã®åœä»€ã»ããããµããŒããããŠããŸãã
Gameboyã¯4ã€ã®DMAãã£ãã«ããµããŒãããŠããŸãã ããã»ããµã«ã¯ãéåžžã®IRQãšé«éFIQã®2çš®é¡ã®å²ã蟌ã¿ããããŸãããã³ã³ãœãŒã«ã§ã¯åŸæ¥ã®å²ã蟌ã¿ã®ã¿ã䜿çšãããŸãã
ARM7ã«ã¯ãåçŽãª3段éã®ãã€ãã©ã€ã³ããããŸãã
ã³ãã³ãã¯ã¡ã¢ãªããååŸããããã¥ãŒã«å ¥ããããŸã
ãã³ãŒããããã³ãã³ã
ã³ãã³ãã¯å®è¡äžã§ãã ãã®å Žåãã¬ãžã¹ã¿ããã®èªã¿åããçµæã®èšç®ãããã³ã¬ãžã¹ã¿ãžã®æžã蟌ã¿ãè¡ãããŸãã
ãããã£ãŠããã€ã§ã1ã€ã®ã³ãã³ããå®è¡ããã次ã®ã³ãã³ãããã³ãŒãããã1ã€ã®ã³ãã³ããååŸãããŸãã
芪æ
RISCããã»ããµã®æ¯èŒçäžå©ãªç¹ã¯ãã³ãŒããæ¯èŒç倧ããããšã§ãã ããã«ãããããã°ã©ã ã®ãµã€ãºã倧ãããªãããã£ãã·ã¥å¹çã®æ倱ãéå°ãªã¡ã¢ãªãã©ãã£ãã¯ãããã³é»åæ¶è²»ã«ã€ãªãããŸãã çµã¿èŸŒã¿ã¢ããªã±ãŒã·ã§ã³ã®å Žåãããã¯ç¹ã«æªãã§ãã ã³ãŒããå§çž®ããããã«ãThumbã¢ãŒããã¯ãã£ãéçºããŸããã
Thumbã¯ã16ãããã«å§çž®ããã32ãããARMã³ãã³ãã®ã·ã¹ãã ã§ãã æãäžè¬çãªäžé£ã®åœä»€ããµããŒããããŠããŸãã åã32ãããã®ã¬ãžã¹ã¿ã§åäœããŸãã Thumb察å¿ããã»ããµã®ãã€ãã©ã€ã³ã«ã¯ãéåžžã®ARMåœä»€ã«å€æãããã³ãŒããŒãè£ åãããŠããŸãã éãã¯æ¬¡ã®ãããªãã®ã§ãã
- ã³ãŒãã®35ïŒ ãç¯çŽ
- ããã«40ïŒ ã®ããŒã ãå¿ èŠ
- 32ãããã¡ã¢ãªã®ã³ãŒãã¯40ïŒ é ã
- ãã ãã16ãããã§ã¯60ïŒ é«é
- æ¶è²»é»åã30ïŒ åæž
äžè¬çã«äœ¿çšãããARMã³ãã³ããšThumbã³ãã³ãã®çµã¿åããã å®è¡ãããã³ãã³ãã®ã¿ã€ãã¯ãç¹å¥ãªãã©ã°ã§ç€ºãããŸãã Gameboyã«ã¯ããããäžã«32 KBã®é«éã¡ã¢ãªããããŸãã éåžžãé床ãéèŠãªã³ãŒãã¯ããããå®è¡ãããŸãã ä»ã®ãã¹ãŠã¯ãThumbã§äœæããäœéã®ã«ãŒããªããžã¡ã¢ãªããå®è¡ããã®ã«é©ããŠããŸãã
habrahabr.ru/post/92494-ARMã«é¢ããäžè¬çãªåèè³æ ã -çŽ perevã
é«ã¬ãã«ã®gbaunixã¢ãŒããã¯ãã£
gbaunixã¯ãGameboyã§çºå£²ãããUNIX 5ãšãã£ã·ã§ã³ã§ãã ãã®ããã«ãCã§æžãããããŸããŸãªã¢ã³ãã£ãŒã¯ã³ã³ãã¥ãŒã¿ãŒã®ã·ãã¥ã¬ãŒã¿ãŒã§ããSIMHã䜿çšãããŸããSIMHã¯ä»ã®å€ãã®ãã®ããšãã¥ã¬ãŒãã§ããŸãããããã§ã¯PDP-11ã®ã¿ã䜿çšãããŸãã Gameboyã«ã¯ããã€ãã®CããŒã«ãã§ãŒã³ããããSIMHãå°ãã®è¡ã§Gameboyã«ç§»æ€ããããšãå€æããŸããã çµæã®ã·ã¹ãã ã®ã¢ãŒããã¯ãã£ã以äžã«ç€ºããŸãã

gbaunixã«ãŒããªããžã¯ãã·ãã¥ã¬ãŒã¿ã©ã³ã¿ã€ã ãšOSããã®ãã£ã¹ã¯ã€ã¡ãŒãžãé£çµãããã®ã§ãã æ®ãã®ã¹ããŒã¹ã空ã®ãŸãŸã«ããããäœã䟿å©ãªãã®ã䜿çšã§ããŸãã
ã·ãã¥ã¬ãŒã¿ãŒã¯æå°éã«å€æŽãããSIMHã§ãã ã²ãŒã åºæã®æ©èœã¯ãåå¥ã®æœè±¡åã¬ãã«ã§å®è£ ãããŸãã
TTYã®çµè«ã
gbaunixã¯ãSIMHã®ããã¹ã端æ«ãã·ãã¥ã¬ãŒãããŸãã åºåã¯Gameboyã§å®è¡ãããæé ã«ãªãã€ã¬ã¯ããããã²ãŒã ããŒã€ã¯ããããã©ãŒãããããŠç»é¢ã«è¡šç€ºããŸãã ã¹ã¯ããŒã«ããµããŒããããŠããŸãã
printf()
ã¯ããããã¡ãŒå ã§
sprintf()
ã«åå²ãããç»é¢ã«è¡šç€ºãããŸãã
TTYå ¥åã
çŸåšãå¥å šãªå ¥åãµããŒãã¯ãŸã£ãããããŸããã ã³ã³ãã€ã«äžã«å®çŸ©ãããäžé£ã®ã·ã§ã«ã³ãã³ãã®ã¿ãå®è¡ã§ããŸãã
gba/gba_kbd.h
æå®ãããŠã
gba/gba_kbd.h
ã UNIXãå®è¡ãããŠããå Žåã[ã¹ã¿ãŒã]ãã¿ã³ã¯ãªã¹ããã次ã®ã³ãã³ããçºè¡ããŠå®è¡ããŸãã ãã¿ã³ã®æŒäžãããŒãªã³ã°ããŸãã¯äžæãç£èŠã§ããŸãã äŸïŒ
/* gba/gba_kbd.h */ const char *gba_kbdinput[] = { "unix\r", "root\r", "chdir /work\r", "ls -l\r", "./fact 100\r", "cat hanoi.c\r", "./hanoi\r", "./hanoi 3\r", "chdir /tmp\r", "echo 'main() { printf(\"Hello, World!\\n\"); }' \ > hello.c\r", "cc hello.c\r", "./a.out\r", ... /* more commands */ NULL, };
ãã¡ã€ã«ã·ã¹ãã ã
ãã£ã¹ã¯ã€ã¡ãŒãžã®ãµã€ãºã¯2.5 MBã§ãã«ãŒããªããžROMã«ã®ã¿åãŸããŸãã ãã®ã¡ã¢ãªã¯èªã¿åãå°çšã§ãããäœããã®æ¹æ³ã§æžã蟌ã¿ãåŠçããå¿ èŠããããŸãã ãããè¡ãã«ã¯ãåæžã蟌ã¿æäœã§RAMã«ãããã¡ãŒãäœæããŸãã ãã¹ãŠã®èªã¿åãããã³æžã蟌ã¿æäœã¯ãæåã«ãããã¡ããã§ãã¯ãããŸãã ãã®ãããªãããã¡ã®æ°ãå¢ãããšããããã¯ããŒãžãããŸãã ä»®æ³stdioã¯ãã·ãã¥ã¬ãŒã¿ãŒã«ã¹ãªãããããŸãã
ã¡ã¢ãªã
ã·ãã¥ã¬ãŒããããPDP-11ã«ã¯ãããŒããŠã§ã¢ã§äœ¿çšå¯èœãª128 KBã®å©çšå¯èœãª256 KBã®EWRAMããããŸãã DMAã䜿çšãããªã©ãã¡ã¢ãªãæäœããæé©åãããã€ããããŸãã
ãã®ä»
ããã§ã¯ãã©ã³ã¿ã€ã ã®åæåãTTYãå²ã蟌ã¿ããã¡ã€ã«ã·ã¹ãã ãªã©ã®ã³ãŒãã
éçº
gbaunixã¯ãGameboyãšãã¥ã¬ãŒã¿ãšIron Consoleã®äž¡æ¹ã§åäœããŸãã ããŒããŠã§ã¢ã§å®è¡ããã«ã¯ããã©ãã·ã¥ã«ãŒããªããžãšãã®ããã®ããã°ã©ããå¿ èŠã§ãã
ç¹ã«ãœãŒã¹ããããããããšããèŠæãããå Žåã¯ãGemyboyãšãã¥ã¬ãŒã¿ã䜿çšããæ¹ãã¯ããã«äŸ¿å©ã§ãã gbaunixã¯äŸç¶ãšããŠéåžžã«æ¡ä»¶ä»ãã§æé©åãããŠãããéã®ã³ã³ãœãŒã«ã§ã¯éåžžã«ãã£ãããšåäœããŸãã ãšãã¥ã¬ãŒã¿ã䜿çšãããšã䜿çšå¯èœãªæé«é床ã§äœæ¥ã§ããããã«ããå€ãã®ç¥çµãç¯çŽãããŸãã
ç§ã®éçºç°å¢ã¯Mac OS Xçšã«ãããã€ãããŠããŸãããã€ã³ããã¢ããã³ã¹ãšãã¥ã¬ãŒã¿ãŒãšãåææããæ§ç¯ãããdevkitARMããŒã«ãã§ãŒã³ã䜿çšããŠããŸãã ãã©ãã·ã¥ã«ãŒããªããžãåããå®éã®ã³ã³ãœãŒã«ã§ç¢ºèªããŸããã
UNIXã®æŽå²ã«ã€ããŠã®åæ çãªäœè«
ããã«ã¯å€§ããªããã¹ãããããèšäºã®äž»é¡ã«çŽæ¥é¢ä¿ããŠããŸãããã奜å¥å¿ã匷ãã®ã§åé€ã§ããŸããã å¥ã®æçš¿ã§ååŸ-habrahabr.ru/post/194160
ã³ã¡ã³ãä»ãã®Gbaunixãã¢
第5çã1974幎6æ
第5çã¯ãé»åçã«ããŠã³ããŒãå¯èœãªã·ã¹ãã ã€ã¡ãŒãžãšã«ãŒãã«ãœãŒã¹ãããæå€ã®ããŒãžã§ã³ã§ããããã䜿çšããŠããŸãã truãªã®ã§ãåã³ã³ãã€ã«ãè©Šã¿ãŸãã
é»æºãå ¥ãããšãgbaunixã¯PDP-11ããŒããŠã§ã¢ã«é¢ããæ å ±ãšããŒãããŒããŒããã³ãã-
@
ãŸãã [
Start
]ãã¯ãªãã¯
Start
ãšãã³ãã³ããã¥ãŒã¯ã«ãŒãã«åãboot-
unix
äžããŸãã é補ã®ã²ãŒã ããŒã€ãžã®ããŒãã«ã¯çŽ2åããããŸãã ããŠã³ããŒãåŸããã°ã€ã³ã®æåŸ ã衚瀺ãããŸãã

æåŸ ç¶ã®ã»ãã³ãã³ïŒ ;ãã°ã€ã³ã¯USENIX Associationãçºè¡ããçŽã®éèªã§ããããŸã ïŒã¯ã1970幎代åæã«äººæ°ã®ãã£ã
Teletype model 37
端æ«ã«å¿ èŠã§ãã 圌女ã¯ãããå šäºéã¢ãŒãã«ããŸãã GBA TTYãå«ãä»ã®ãã¹ãŠã®ç«¯æ«ã¯ãç»é¢ã«æåã衚瀺ããã ãã§ãã
ãã®ãããªåæããŒãžã§ã³ã®UNIXã§ããããããã¯ããã€ã¹ãã¡ã€ã«ãšãã£ã©ã¯ã¿ãŒããã€ã¹ãã¡ã€ã«ãæã£ãŠããŸãã
RK0
ã¯æåã®ãã£ã¹ã¯ã§ãã
/dev/mem
RK0
ãããã¬ãŒã§ãããã°ããããããªãã®ã«ããããé©çšããããã®ã·ã¹ãã ã¡ã¢ãªã衚瀺ããŸãã

glob
ã¯
global
ç¥ã§ãã¡ã¿ãã£ã©ã¯ã¿ãŒ
*
ããã³
?
ãå ¬ââéããããã®ã·ã§ã«å€éšã³ãã³ã
?
ã³ãã³ãåŒæ°ã
glob
ã¯ã¡ã¿æåãå±éããç®çã®ã³ãã³ããåŒã³åºããŸãã äžèŽãããã®ããªãå ŽåãåŸæ¥ã®
No match
ãšã©ãŒã
No match
ãŸãã

å¥åŠãªããšã«ã
mkfs
ãããªããã€ãã®ã³ãã³ãã¯
/etc
ã«é ãããŠãããæ²ãã£ãæã§ã®å¶çºçãªåŒã³åºãããã¯é¢ããŠããŸãã
dc
ã¯éããŒã©ã³ãèšæ³ãåããèšç®æ©ã§ãã ããã¯ããã®ã³ã³ãã¥ãŒã¿ãŒã®UNIXããŒãžã§ã³ãäœæããåã§ãã£ãŠããPDP-11ã§å®è¡ãããæåã®ããã°ã©ã ã§ãã
å žåçãªç¬¬5çã«ãŒãã«ã¯ã26 Kbæªæºãå æããŸãã ã·ã§ã«ã¯5738ãã€ãã
/init
ã¯1972ãã€ãã®ã¿ã䜿çšããŸãã ãŸãšããªã¹ã¯ãªãã
/etc/rc
ãŸãã
/etc/update
ã¯ããã¡ã€ã«ã·ã¹ãã ã®ã¹ãŒããŒãããã¯ã30ç§ããšã«æŽæ°ããŠãé害ã«ããæ倱ãæžãããŸãã
ls
ã®è©³çŽ°ãªåºåã«ã¯ãèš±å¯ããªã³ã¯ã®æ°ãææè ããã€ãåäœã®ãµã€ãºãæçµå€æŽæå»ãããã³ååãå«ãŸããŸãã

第5çã®æ代ã«ã¯ãå€ãã®ããã°ã©ãã³ã°èšèªããµããŒãããè±å¯ãªéçºã€ã³ãã©ã¹ãã©ã¯ãã£ããã§ã«äœæãããŠããŸããã ããšãã°ãAlgol-68ãAPLãã¢ã»ã³ãã©ãBASICãCãFORTRANãM6ãPASCALãSnobolãTMGã ååãšããŠãgbaunixã䜿çšãããšãGameboyã§è€æ°ã®èšèªã§çŽæ¥ããã°ã©ã ã§ããŸãïŒããã¯çè«äžãå®éã«ã¯ãããŒããŒãããªãããã«å°ãªããšãäžäŸ¿ã§ãïŒã ããã±ãŒãžã«ã¯ãCãã¢ã»ã³ãã©ãŒPDP-11ãBASICãã·ã§ã«ãFortrançšã®ã³ã³ãã€ã©ãŒ/ã€ã³ã¿ãŒããªã¿ãŒãå«ãŸããŠããŸãã Algolãè©ŠããŸãããããã£ã¹ã¯ã€ã¡ãŒãžã«è¿œå ããŸããã§ããã ããšãã°ãããã€ã®å¡ã瀺ããŠããŸãã



ã¹ã¯ãªãŒã³ã·ã§ããä»ãã®ç¹å¥ãªããŒãžã§ ãããå€ãã®ã¹ã¯ãªãŒã³ã·ã§ãããèŠãããšãã§ããŸã
åŸç¶ã®ãšãã£ã·ã§ã³
第6çïŒ1975幎5æïŒã¯ãBSDãšXenixã«ã«ãŒãããã£ããããæŽå²ã«å»å°ãæ®ããŸããã John Lyonsã¯ãæåãªã UNIXã®ç¬¬6ããŒãžã§ã³ã«é¢ããLyonsã®ã³ã¡ã³ãããœãŒã¹ã³ãŒãä»ã㧠ãæžããŠããŸã ã ãŸããUNIXã®åæã®å®å šä¿åããŒãžã§ã³ã§ããããŸãã 第5çã®ããã¥ã¡ã³ãã¯å€±ãããŠããŸããã第4çããã³ãã以åã®ãã®ã¯ã»ãšãã©æ®ã£ãŠããŸããã 第6ç以éãUNIXã·ã¹ãã ã®éçºã¯èãã埩掻ããŸããã ãã®åŸã1979幎1æã«7åç®ã1985幎2æã«8åç®ã1986幎9æã«9åç®ã1989幎10æã«10åç®ãç»å ŽããŸããã
BSD
Gameboyã§ã¯ãSIMHã§ãµããŒããããŠããã·ã¹ãã ãããã«ããã€ãå®è¡ã§ããŸãã ããããããã¯ãŸããŸãè€éã«ãªããå©çšå¯èœãªRAMã«ããã£ãŠããŸãã BSD 2.9ã®ã¹ã¯ãªãŒã³ã·ã§ããã®ã«ããã«ïŒ


Gbaunixã®æé©å
Gbaunixã«ã¯ãäœæ¥é床ã«åœ±é¿ããå®éšã®åææ¡ä»¶ããããŸãã ãã ããããã«ã¯åã³ã³ãã€ã«ãå¿ èŠã§ãã
IWRAMã®æ æ²ã³ãŒã
Gbaunixã«ã¯ãARMçšã®ã³ãŒããã³ã³ãã€ã«ããŠIWRAMã«ä¿åããäŸããããŸãã ããã¯ãããããããã»ããµã·ãã¥ã¬ãŒã·ã§ã³ã³ãŒãã«æã圹ç«ã¡ãŸãã
DMA
ã²ãŒã ããŒã€ã§ã¯ãããŸããŸãªããã©ãŒãã³ã¹ãšå¶éã䜿çšããŠãããã€ãã®æ¹æ³ã§ã¡ã¢ãªãæäœã§ããŸãã gbaunixã¯ã
memcpy()
ããã³
memset()
é¢æ°ã«DMA3ïŒæ±çšïŒã䜿çšããŸãã ããã«ãBIOSã«ã¯ããœãããŠã§ã¢å²ã蟌ã¿ãä»ããŠã¡ã¢ãªãã³ããŒããã³å å¡«ããæ©èœãå«ãŸããŠããŸãã äžè¬ã«ãgbaunixã¯ã¡ã¢ãªãæäœããããã®åŸ®èª¿æŽããµããŒãããŠããŸãã
ãã£ãã·ã³ã°
åã«èšã£ãããã«ãgbaunixã¯stdioãšä»®æ³ãã£ã¹ã¯ããšãã¥ã¬ãŒãããã«ãŒããªããžã¡ã¢ãªãUNIXãã¡ã€ã«ãšããŠæ瀺ããŸãã ããŒããŠã§ã¢ã¯ROMãžã®æžã蟌ã¿ãèš±å¯ããªããããäžèšã®ããã«ãããã¡ã䜿çšããå¿ èŠããããŸãã gbaunixã¯ãã£ã¹ã¯ãã©ã°ã¡ã³ãããããã¡ã«ããªããŒãã§ããŸãã ããã«ãããã·ã¹ãã ã®ããŒããå€§å¹ ã«é«éåã§ããŸãã
UNIXã«ãŒãã«ã®åã³ã³ãã€ã«
ã«ãŒãã«ãåã³ã³ãã€ã«ããŠãgbaunixã«é¡èãªå©ç¹ã¯ãããŸããããããã¯ãšã«ããèå³æ·±ããã®ã§ãã å°ãªããšãææ°ã®ã·ã¹ãã ã®åãæé ãšã®æ¯èŒã®ããã«ã éã®ã³ã¢ãµããŒããå¶éããŠãã¹ããŒã¹ãç¯çŽã§ããŸãã
第5çã®ãœãŒã¹ã³ãŒãã®ãµã€ãºãèŠç©ãããŸãã
ããããŒïŒ13ãã¡ã€ã«ã«418è¡
CïŒ43ãã¡ã€ã«ã«7,222è¡ïŒåšèŸºæ©åšãã©ã€ããŒãå«ãïŒ
ã¢ã»ã³ãã©ãŒïŒ2è¡ã§1080è¡
Gameboyã§ã«ãŒãã«ãçŽæ¥ã³ã³ãã€ã«ããããšããããŸããã§ããã ããã«ã¯ç¡æéã«é·ãæéããããããããã¡ã¡ã¢ãªãäžè¶³ããŸãã ãšã«ããããã®ãããªã¿ã¹ã¯ã®ããã®æ©åšã¯äœé»åã§ãã
次ã®ã³ãã³ãã·ãŒã±ã³ã¹ã¯ãå®éã®ããŒããŠã§ã¢ãŸãã¯ã·ãã¥ã¬ãŒã¿äžã«ã第5çã®ã€ã³ã¹ããŒã«ãæ©èœããããã©ã«ããã£ã¬ã¯ããªã®ã«ãŒãã«ãœãŒã¹ã
/usr/sys
ã§ããããšãåæãšããŠããŸãã
åã®ã³ã³ãã€ã«ããæ®ã£ãŠããå¯èœæ§ã®ããã©ã€ãã©ãªãåé€ããŸãã
# chdir /usr/sys # rm -f lib1 # rm -f lib2
ã³ã³ãã€ã«ãéå§ããåã«ããã¡ã€ã«
/usr/sys/param.h
ãã©ã¡ãŒã¿ãŒã調ã¹ãŠæ£ããæå®ããå¿ èŠããããŸãã
ã³ã³ãã€ã©ãŒããšã©ãŒã
undefined KISA0
ããçæããå Žåãå®çŸ©ã
/usr/sys/seg.h
è¿œå ããŸãã
# echo '\#define KISA 0172340' >> /usr/sys/seg.h
å®éã®ã³ã³ãã€ã«ïŒ
# chdir ken # cc -c -O *.c ... # ar vr ../lib1 main.o alloc.o iget.o prf.o rdwri.o \ slp.o subr.o text.o trap.o sig.o sysent.o clock.o fio.o \ malloc.o nami.o pipe.o sys1.o sys2.o sys3.o sys4.o ...
ãã©ã€ããŒãªã©ã®ã³ã³ãã€ã«ã éšåçã«ç¡å¹ã«ã§ããŸãïŒ
# chdir ../dmr # cc -c -O *.c ... # ar vr ../lib2 *.o
ã·ã¹ãã æ§æãšãªã³ã¯ã åºåã¯ã«ãŒãã«ãã€ããªã§ãã
# chdir ../conf # cc mkconf.c # mv a.out mkconf # echo rk | ./mkconf # cc -c cc # as ls # mv a.out lo # as mch.s # mv a.out mch.o # ld -x lo mch.o co ../lib1 ../lib2 # mv a.out rkunix
rkunix
ããã¯æ°ããã³ã³ãã€ã«ãããã«ãŒãã«ã§ãã ã«ãŒããã£ã¬ã¯ããª
/rkunix
ã«é 眮ããèµ·åæã«
unix
ã§ã¯ãªã
rkunix
ã³ãã³ãã
rkunix
ãããšãèµ·åããŸãã
ã¢ã€ãã¢ãšææ¡
ææãªã¢ã€ãã¢ã®çããªã¹ãã äž»ã«åŠåçé¢å¿
Gamboyã®ãã€ãã£ãUNIXããŒã
UNIXãGameboyã«ç§»æ€ããããšã¯ããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã³ãŒã¹ã®äžç°ãšããŠãåŠçã«ãšã£ãŠè¯ãç·Žç¿ã«ãªãã§ãããã çç£æ§ã¯åçã«åäžããã¯ãã§ãã å€ä»£ã®OSã¯ãäžäººã®äººéã®é ã«åãŸãã»ã©å°ããã 第6çã¯44åã®ãã¡ã€ã«ã§æ§æãããŠããŸãã
14ã®èŠåºãC
Cã³ãŒãã®28ãã¡ã€ã«
ã¢ã»ã³ãã©ãŒã䜿çšãã2ã€ã®ãã¡ã€ã«ã
ãã¹ãŠãåãããŠ9000è¡æªæºã®ã³ãŒããå«ãŸããŠããŸãã ããã¯ããã€ã¹ãã©ã€ããŒã䜿çšããŸãã ã¢ã»ã³ãã©ãŒã¯çŽ10ïŒ ã§ãã
ç§ã®æèŠã§ã¯ãã¿ã¹ã¯ã¯éåžžã«å®è¡å¯èœã§ãã ã¢ã»ã³ãã©ã³ãŒããšã³ã³ãã€ã©ã®ç§»æ€ã«åé¡ãããå ŽåããããŸãã
ããã©ãŒãã³ã¹ã®æ¹å
å¯èœãªéãäœæ¥ãé«éåããããšããŸããããããã§ãæçµçãªè§£æ±ºçã«ã¯ãŸã é·ãéã®ãããããŸãã ããã»ããµã·ãã¥ã¬ãŒã·ã§ã³ã³ãŒãïŒ
pdp11_cpu.c
ïŒããéå§ã§ããŸã-å®è¡ãããæéã®å²åã¯æ倧ã§ãã
å ¥åæ©æ§
gbaunixã¯ãã³ã³ãã€ã«äžã«é ç·ãããã³ãã³ããã¥ãŒãå®è¡ããã ãã§ãã çŸå®ã«è¿ã¥ãã«ã¯ããŠãŒã¶ãŒãã³ãã³ããå ¥åããæ¹æ³ãå¿ èŠã§ãã ãŸãã¯ã端æ«ã§æ£åžžã«åäœããä»®æ³ããŒããŒããæäŸã§ããŸãã
ãªãªãžãã«Macintoshã®ã²ãŒã Macãšãã¥ã¬ãŒã·ã§ã³
æåã®Macintoshã¯ç¹ã«é«åºŠãªããŒããŠã§ã¢ã§ã¯ãããŸããã§ãããåšæ³¢æ°ã8 MHzã®16ãããããã»ããµã128 KB RAMã64 KB ROMããã£ãã·ã¥ãªããå²ã蟌ã¿ãªãã400 KBãããããŒãã£ã¹ã¯ã解å床512x342ã®ã¢ãã¯ãç»é¢ã ã²ãŒã ããŒã€ã«ã¯ãç»é¢ãé€ããããã«åŒ·åãªããŒããŠã§ã¢ããããŸãã ååãšããŠã軜éã®Macintoshãšãã¥ã¬ãŒã¿ãäœæãŸãã¯ç§»æ€ã§ããŸãã ã¹ã¯ããŒã«ããããšã§ç»é¢ã®äžè¶³ãè£ãããããã¡ãªã©ã䜿çšããŠãã£ã¹ã¯ãžã®æžã蟌ã¿ãã·ãã¥ã¬ãŒãããŸãã
å¥ã®ãªãã·ã§ã³ã¯ã8088ãšãã¥ã¬ãŒã¿ã移æ€ããŠDOSã®å€ä»£ããŒãžã§ã³ãå®è¡ããããšã§ãã
ããŠã³ããŒãå
gbaunix-0.0.tar.bz2
å®è¡ããã«ã¯ãRK05ãã£ã¹ã¯ã€ã¡ãŒãžãå¿ èŠã§ããããšã«æ³šæããŠãã ããã å«ãŸããŠããŸããããã©ã€ã»ã³ã¹å¥çŽã®æ¡ä»¶ã«åæããå Žåã¯ãPDP Unix Preservation Society Webãµã€ãããããŠã³ããŒãã§ããŸãã
http://minnie.tuhs.org/PUPS/
䜿çšãã
èŠããã ããªããåã³ã³ãã€ã«ããã«ã·ãã¥ã¬ãŒã¿ãŒã©ã³ã¿ã€ã ãšãã£ã¹ã¯ã€ã¡ãŒãžããŸãšããããšãã§ããŸãã
% cat unixv5.tmp disks/unixv5.dsk > unixv5.gba
unixv5.gba
ã¯ãããã«èµ·åã§ããã€ã¡ãŒãžã«ãŒããªããžã§ãã ãšãã¥ã¬ãŒã¿ãŒãšã¢ã€ãã³ã³ã³ãœãŒã«ã®äž¡æ¹ã§äœ¿çšã§ããŸãã
gbaunixãåã³ã³ãã€ã«ãããå ŽåïŒåŒ·ããå§ãããŸãããããããã»ã¹ã楜ããå¯äžã®æ¹æ³ã§ãïŒãARMã¢ãŒããã¯ãã£çšã®ã¯ãã¹ã³ã³ãã€ã«ç°å¢ãå¿ èŠã«ãªããŸãã Makefileãä¿®æ£ããå¿ èŠãããå ŽåããããŸãã RK05ã€ã¡ãŒãžã«ã¯ã
disks/unixv5.dsk
ãšããååãä»ããå¿ èŠããããŸãã ãã®åŸãçè«çã«ã¯ã1ã€ã®
make
ã³ãã³ãã§ååãªã¯ãã§ãã
ãã®ãããã¯ã§ä»ã«èªãã¹ãããš
UNIXã®å€ãããŒãžã§ã³ã®ãœãŒã¹ããã€ããªãããã³ããã¥ã¡ã³ã
ããã¹ã»ãªãããŒã®æè©
SIMHããã¥ã¡ã³ã