UNIXv1ã«ãããå¶å¾¡æåãç¨ããclearã³ãã³ãã®ä½ãæ¹
ã¯ããã«
æ¬è¨äºã¯ãæ¥æ¬é°ãã£åä¼ Advent Calendar 2022ãã«ããã12æ¥ç®ã®è¨äºã«ãªãã¾ãã
ç®æ¬¡
- ã¯ããã«
- ç®æ¬¡
- åä½ç¢ºèªã«é¢ãã¦
- UNIXv1ã¨ã¯
- å¶å¾¡æåã¨ã¯ï¼
- clearã³ãã³ãã¨ã¯ï¼
- å¦çã®æµã
- last1120cãç¨ããå®è£
- 使ã£ã¦ã¿ã
- ã¾ã¨ã
- åèæç®
åä½ç¢ºèªã«é¢ãã¦
ä»åã®æ¹æ³ã¯ManjaroLinuxã«ãããkonsoleã«ã¦åä½ç¢ºèªãè¡ãã¾ãããã¾ããå¶å¾¡æåã«ä¾åãã¦ãããããå ¨ã¦ã®ç«¯æ«ã§åä½ããã¨ã¯éãã¾ããã
UNIXv1ã¨ã¯
UNIXv1ã¨ã¯1971å¹´ã«å ¬éãããUNIXã®1st Editionã¨ãªãã¾ããã¾ããç¹å¾´ã¨ãã¦ãã«ãã¿ã¹ãã³ã°ããã«ãã¦ã¼ã¶ã¼ãé層åãã¡ã¤ã«ã·ã¹ãã æã£ã¦ãããç¾ä»£ã®OSã«ã¤ãªããè¦ç´ ãæã£ã¦ãã¾ãã
å¶å¾¡æåã¨ã¯ï¼
å¶å¾¡æåã¨ã¯ãæåã³ã¼ãã§æ±ºããããå¨è¾ºæ©å¨ã®å¶å¾¡ãªã©ã«ç¨ããç¹æ®ãªæåã®ãã¨ã§ããä»åå©ç¨ããã®ã¯ãã¿ã¼ããã«ãå¶å¾¡ããã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ã¨ãªãã¾ãã
clearã³ãã³ãã¨ã¯ï¼
端æ«ã®ç»é¢ãã¯ãªã¢ã«ããã³ãã³ãã«ãªãã¾ãã
å¦çã®æµã
å¦çã®æµãã¯ä»¥ä¸ã®ããã«ãªãã¾ãã
last1120cãç¨ããå®è£
ä¸è¨ã³ã¼ããå ¨ä½ã®ã½ã¼ã¹ã³ã¼ãã«ãªãã¾ãã
/* clear command */ main(){ extern clear, rcur; clear(); rcur(); return; } /* clear:screen clear */ clear(){ extern esc; esc("2J"); } /* rcursor: reset curosor */ rcur(){ extern esc; esc("H"); } /* esc */ /* code:escape sequences code */ esc(code) char code[]; { extern printf; printf("%c[%s", 033, code); }
escé¢æ°
ã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ãçºè¡ããå¦çãè¡ãé¢æ°ã§ãã033ãï¼ãã¤ãã®8é²æ°ã¨ãã¦è¡¨ç¤ºãããæååã¨ãã¦ç¶ãcodeãåºåãã¾ãã
/* esc */ /* code:escape sequences code */ esc(code) char code[]; { extern printf; printf("%c[%s", 033, code); }
clearé¢æ°
ç»é¢ãã¯ãªã¢ããã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ãåºåããå¦çãè¡ãé¢æ°ã§ãã"\033[2J"ãåºåããã¾ãã
/* clear:screen clear */ clear(){ extern esc; esc("2J"); }
rcuré¢æ°
ã«ã¼ã½ã«ä½ç½®ã0è¡ç®ã®0æåç®ã«ç§»åããå¦çãè¡ãé¢æ°ã§ãã "\033[H"ãåºåããã¾ãã
/* rcursor: reset curosor */ rcur(){ extern esc; esc("H"); }
使ã£ã¦ã¿ã
ãããªã«ãã®æ¨ã...ã
è¦ã¦ããã¨å¿ãå·ãã§ããã®ã§æ¶ãã¦ããã¾ãããã
ããã§å¿ã®å®å¯§ã¯ä¿ããã¾ããã
ã¾ã¨ã
ã¯ãªã¹ãã¹ã¯æ¶ãã¾ããï¼ï¼ï¼
PS)
æ¶ããããã人ã¯ãã¯ãªã¹ãã¹ï¼ãªã«ããç¾å³ããã®ï¼ããèããªããå½æ¥ãéããã¾ãããã
åèæç®
The Restoration of Early UNIX Artifacts
https://www.usenix.org/legacy/event/usenix09/tech/full_papers/toomey/toomey.pdf:
FreeBSD Manual Pages - clear
https://www.freebsd.org/cgi/man.cgi?query=clear&apropos=0&sektion=0&manpath=FreeBSD+13.1-RELEASE+and+Ports&arch=default&format=html
ããã°ã©ãã³ã°è²ã
http://7ujm.net/etc/esc.html
UNIXv1ã®æä½æ¹æ³ã«é¢ãã¦
ã¯ããã«
æ¬è¨äºã§ã¯ãåæUNIXã§ããResearch Unix version1ï¼ä»¥éUNIXv1ï¼ãæä½ããããã®åºæ¬çãªç¥èãæä½æ¹æ³ããã³æ³¨æç¹ãè¨è¼ããã
ååã®è¨äº
ããã
- ã¯ããã«
- ååã®è¨äº
- ããã
- UNIXv1ã®ãã£ã¬ã¯ããªæ§é
- ããã»ã¹
- ã·ã§ã«ã®æä½æ¹æ³
- ãã®ä»æ³¨æäºé
- ããã¥ã¢ã«ããã¦ã³ãã¼ã
- æå¾ã«
- åè
- 次å
UNIXv1ã®ãã£ã¬ã¯ããªæ§é
å³1ã§ã¯UNIXv1ã«ããããã£ã¬ã¯ããªæ§é ãå³ã«èµ·ããããã®ã§ãããtmpãã£ã¬ã¯ããªã®ä¸èº«ã¯æåããåå¨ããutmpã¨edã³ãã³ãã§å©ç¨ãããetm* ãè¨è¼ãã¦ããã使ç¨ããããã°ã©ã ã«ãã£ã¦ã¯ä»ã®tmpãã¡ã¤ã«ãçæããããã¨ãããã
ããã»ã¹
å³2ã¯èªä½ããpsã³ãã³ãã®åºåçµæã§ãããããã§ã¯SLOTã16åã¾ã§ãããªãã¨çåãæããã¨æããããã¯ãUNIXv1ã16åã¾ã§ã®ããã»ã¹ãã管çã§ããªããããã®ãããªè¡¨è¨ã¨ãªã£ã¦ãããã¾ããåºæ¬çã«SLOT1ã¯initã«ãSLOT2~10ã¯ç«¯æ«ãã·ã¹ãã ã³ã³ã½ã¼ã«ã«å©ç¨ããã¦ãããããæ®ã6åã®SLOTãã¦ã¼ã¶ã¼ã«ãã£ã¦å©ç¨ã§ããããã»ã¹ã¨ãªãã
ã·ã§ã«ã®æä½æ¹æ³
ãã°ã¤ã³
rootã¦ã¼ã¶ã¼ãã°ã¤ã³ããããå ´åã¯login:ã®éã«rootã¨å ¥åãã¦ã¼ã¶ã¼ãã°ã¤ã³ããããå ´åã¯login:ã®å¾ã«ã¦ã¼ã¶ã¼åãå ¥åããã
ã¦ã¼ã¶ã¼ken
root
ãã°ã¤ã³å¯è½ãªããã©ã«ãã®ã¦ã¼ã¶ã¼ã¯ä»¥ä¸ã¨ãªãã
ken jack
ãã°ã¢ã¦ã
Ctrl-d(EOF)ãæ¼ããã¨ã§ãã°ã¢ã¦ããã§ããã
ãã£ã¬ã¯ããªã®ç§»å
chdirã³ãã³ããå©ç¨ãã¦ç§»åããã
@ chdir ..
æå¾ã/(ã¹ã©ãã·ã¥)ã§çµããã¨ã¨ã©ã¼ã¨ãªãã
@ chdir ../ Bad directory
ãã£ã¬ã¯ããªå é¨ã®ãªã¹ã
lsã³ãã³ããå©ç¨ãããã¨ã§åå¾ãã§ããã
@ ls as2 getty glob init msh passwd std0 suftab uids @
ls -alããµãã¼ãããã¦ãã
@ ls -al total 34 104 sdrwr- 2 root 110 Jan 1 00:00:00 . 41 sdrwr- 7 root 110 Jan 1 00:00:00 .. 106 lxrwr- 1 bin 5778 Jan 1 00:00:00 as2 105 sxrwr- 1 bin 446 Jan 1 00:00:00 getty 107 sxrwr- 1 sys 2662 Jan 1 00:00:00 glob 108 sxrwr- 1 sys 1192 Jan 1 00:00:00 init 109 sxrwr- 1 sys 186 Jan 1 00:00:00 msh 110 s-rw-- 1 sys 299 Jan 1 00:00:00 passwd 111 s-rwr- 1 root 512 Jan 1 00:00:00 std0 112 s-rwr- 1 bin 2082 Jan 1 00:00:00 suftab 113 s-rwr- 1 sys 96 Jan 1 00:00:00 uids @
ããã³ãã
rootã¦ã¼ã¶ã¼ã®å ´å#ãuserã¦ã¼ã¶ã¼ã®å ´å@ãããã³ããã¨ãã¦è¡¨ç¤ºããããã
ã¦ã¼ã¶ã¼ken
root
é次å¦ç
ã³ãã³ãã®é次å¦çã¯;(ã»ãã³ãã³)ãå©ç¨ãã¦ã§ããã
@ ls; ls
åæå®è¡
&ãå©ç¨ãã¦åæå®è¡ãè¡ããããã¨ãã§ããã
@ ls & ls
ããã¯ã°ã©ã¦ã³ãããã»ã¹
å ¥åã®æå¾ã&ã«ãã¦ã³ãã³ããå®è¡ããå ´åãããã¯ã°ã©ã¦ã³ãããã»ã¹ã¨ãã¦ç¨¼åããããã¨ãã§ããã
@ ls &
注æãã¦ã»ããã®ããããã¯ã°ã©ã¦ã³ãããã»ã¹ãç¡éã«ã¼ãã§ç¨¼åãããå ´åãããã¯ã°ã©ã¦ã³ãããã»ã¹ã®æ°ã«ãã£ã¦ã¯ã·ã¹ãã ããã³ã°ã¢ããããã¨ãããã¨ã§ããã
ãªãã¤ã¬ã¯ã
ç¾å¨ã«ããããªãã¤ã¬ã¯ããããããã¡ã¤ã«åã®å é 2æåãç¹æ®æ±ããããã¨ã§åä½ãããã¨ã«æ³¨æã
æ¨æºåºå
@ ls >file
æ¨æºå ¥å
@ cat <file
æåå
"(ããã«ã¯ã©ã¼ãã¼ã·ã§ã³)ã'(ã·ã³ã°ã«ã¯ã©ã¼ãã¼ã·ã§ã³)ã«ãã£ã¦è¡¨ç¾ãã§ããã
@ echo "hello"
æåã®åé¤
æåã®åé¤ã¯#ã使ãå ¥åãè¡ããç»é¢ä¸ã§ã¯#ã¨ãã¦å ¥åããã¦ããããã«è¦ããããã·ã¹ãã å é¨ã§ã¯ï¼æååé¤ããããã®ã¨ãã¦æ±ããã¦ãããããã#ãå ¥åãããå ´åã¯\#ã¨ã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ãå©ç¨ãã¦å ¥åããã
@ echo "hello#####unix" unix
è¡ã®åé¤
è¡åä½ã§åé¤ããå ´åã¯@ãå©ç¨ããããããå ¥åãããå ´åãè¡é ãã@ãå ¥åãããç®æã¾ã§ã®å ¥åãç¡å¹åãããã@ãå ¥åãããå ´åã¯\@ã¨ã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ãå©ç¨ããã
@ echo "hello"@echo "unix" unix
å²è¾¼ã¿
ç¡éã«ã¼ãããã°ã©ã ãªã©ã稼åãããå ´åã«ä¸æ¢ããããå ´åãASCII DELãå ¥åãããã¨ã§ä¸æ¢ãããã¨ãã§ãããç¾ä»£ã®ãã¼ãã¼ãã§ã¯BackSpaceãDelãã¼ãå ¥åãããã¨ã§ASCII DELã®éä¿¡ãã§ãããå®è¡ãã¦ããæ¹æ³ã¯å²ã¨ããªããã¼ãªæ¹æ³ã§ããããããããã
æ£è¦è¡¨ç¾
åæã®åç´ãªæ£è¦è¡¨ç¾ã¨ãã¦?ã * ãåå¨ããã
?ã¯ä¸æåãããã¨ãªã
@ ls ma?i.s maki.s @
*ã¯ã¯ã¤ã«ãã«ã¼ãã¨ãªãã
@ ls *.a bilib.a filib.a liba.a libb.a libc.a libf.a @
ãã®ä»æ³¨æäºé
æ±ããããã»ã¹ã®å¶é
ããã»ã¹ã¯ç«¯æ«ã®ããã»ã¹ãåããã¦16åã¾ã§ããå®è¡å¯è½ç¶æ ã«ã§ããªããããããã以ä¸ã®ããã»ã¹ãç«ã¡ä¸ãããã¨ããå ´å
@ ls Try again
ã¨ããè¦åãåºåãããå®è¡ãããã¨ãã§ããªãã端æ«ãinitã®ããã»ã¹ã¯1~10ã¾ã§ã®ããã»ã¹ã¨ãã¦å¸¸ã«å©ç¨ãã¦ãããããæ®ãã®6åãæ±ããã¨ãããã¨ã«ãªãã
åããã¦ããã«ã¼ãã«ã¤ã¡ã¼ã¸ããã³ãã¤ããªã«é¢ãã¦
ä»ååããã¦ããUNIXv1ã®ã¤ã¡ã¼ã¸ã¯ç´ç²ãªUNIXv1ã§ã¯ãªããã³ãã³ãã«ã¯UNIXv2ã®ãã¤ããªãå©ç¨ããã¦ããããããå©ç¨ããããã«UNIXv1ã«ã¯ããããæ½ããã¦ãããã¾ããCè¨èªãåä½ãããããã«ã¦ã¼ã¶ã¼ç©ºéã®æ¡å¼µãè¡ããã¦ããã
ããã¥ã¢ã«ããã¦ã³ãã¼ã
ä¸è¨ã®å ´æã«å ¬éãããã¦ããã
UNIXv1
https://www.tuhs.org/Archive/Distributions/Research/Dennis_v1/UNIX_ProgrammersManual_Nov71.pdf
ãããOCRåãããææ¸ã欲ããå ´åã以ä¸ã®å ´æã«å ¬éããã¦ãããåç« ã«åããã¦ããã®ã¯pdfuniteã³ãã³ãçã§é£çµããã°ä¾¿å©ã§ããã
UNIXv2
å®è¡ãããåºæ¬ã³ãã³ãã¯UNIXv2ã®ãã®ã§ãããããã³ãã³ããªã©ã¯ãã¡ããåç §ããæ¹ãè¯ãã
https://www.tuhs.org/Archive/Distributions/Research/Dennis_v2/unix_2nd_edition_manual.pdf
æå¾ã«
次åã¯åºæ¬çãªã³ãã³ãã®å©ç¨ã«ã¤ãã¦è¨äºã«ããäºå®ã§ããã
åè
- å³ã®ä½æã«ã¯Flowchart Maker & Online Diagram Softwareãå©ç¨
- GitHub - dspinellis/unix-history-repo at Research-V2 : UNIXv2ã«ãããã½ã¼ã¹ã³ã¼ã
- Unix Manual, first edition : UNIXv1ã®ã¦ã¼ã¶ã¼ããã¥ã¢ã«
次å
æªå ¬é
UNIXv1ã®ã¨ãã¥ã¬ã¼ã·ã§ã³ç°å¢ã®æ§ç¯
ã¯ããã«
æ¬è¨äºã§ã¯ãåæUNIXã§ããResearch Unix version1ï¼ä»¥éUNIXv1ï¼ãPDP-11/20ã®ã¨ãã¥ã¬ã¼ã·ã§ã³ãå¯è½ãªsimhãå©ç¨ãç°å¢æ§ç¯ããææ³ã説æããã
ç®æ¬¡
- ã¯ããã«
- ç®æ¬¡
- 説æããç°å¢ã«é¢ãã¦
- ä½æ¥ãã£ã¬ã¯ããªãç¨æ
- simhã®ãã«ã
- ã¤ã¡ã¼ã¸ã®æºå
- åæ¢ã®ããæ¹
- æå¾ã«
- 次å
説æããç°å¢ã«é¢ãã¦
ä»åç°å¢æ§ç¯ãããã«ããã£ã¦Ubuntu 20.04.4 LTS x86_64ãç¨ãã¦ç°å¢æ§ç¯ãè¡ã£ãã
ä½æ¥ãã£ã¬ã¯ããªãç¨æ
$ mkdir UNIXv1 $ cd UNIXv1
simhã®ãã«ã
simhãã½ã¼ã¹ã³ã¼ããããã«ãããã
ãã«ãã«å¿ è¦ãªããã±ã¼ã¸ã®æºå
$ sudo apt install build-essential $ sudo apt install libpcap-dev $ sudo apt install bridge-utils $ sudo apt install uml-utilities
simhã®æºå
ã¾ããã¨ãã¥ã¬ã¼ã¿ã§ããsimhããã«ããããsimhã¯githubã«ããããªãã¸ããª(https://github.com/simh/simh)ã§éçºãããã¦ããããã£ã¦ããã®ãªãã¸ããªãä»»æã®ãã£ã¬ã¯ããªã«ãã¦ã³ãã¼ããããã¾ãããã®è¨äºãæ¸ããæsimhã®masterã¯version4ã§ããã
$ wget https://github.com/simh/simh/archive/refs/heads/master.zip -O simh.zip $ unzip simh.zip
simhã®ãã«ã
simhãã£ã¬ã¯ããªå ã«å ¥ãããã«ããè¡ãã
$ cd simh-master $ make pdp11
ãã«ããããå®è¡ãã¡ã¤ã«ã¯simh-master/BIN/pdp11ã¨ãã¦åå¨ããã
ã¤ã¡ã¼ã¸ã®æºå
ã¤ã¡ã¼ã¸ã®ãã¦ã³ãã¼ã
UNIXv1ãã£ã¬ã¯ããªã«æ»ããã¤ã¡ã¼ã¸é¢é£ã®å§ç¸®ãã¡ã¤ã«ããã¦ã³ãã¼ãããã
$ wget https://www.tuhs.org/Archive/Distributions/Research/Dennis_v1/images-20080625.tgz -O V1image.tgz $ mkdir V1image; tar -xzvf V1image.tgz -C V1image --strip-components 1
ãã£ã¬ã¯ããªã®æ§æã以ä¸ã®ããã«ãªã£ã¦ãããã確èªããã
UNIXv1 âââ V1image âââ V1image.tgz âââ images-20080625 âââ pdp11 âââ simh-master âââ simh.zip
ãã®éãsimh.zipã¯åé¤ãã¦ã大ä¸å¤«ã ããã¤ã¡ã¼ã¸å ã®ç°å¢ãå£ãã¦ãã¾ã£ãå ´åããªã»ãããããå ´åã®ããã«V1image.tgzã¯ä¿æãã¦ãããã¨ããå§ãããã
UNIXv1ã®èµ·å
simh.cfgãèµ·åã¹ã¯ãªããã¨ãã¦æ¸¡ããUNIXv1ãèµ·åããã
$ cd V1image $ ../simh-master/BIN/pdp11 simh.cfg
以ä¸ã®ãããªè¡¨ç¤ºããããå ´åUNIXv1ã®èµ·åã«ã¯æåãã¦ããã
åæã»ããã¢ãã
rootã§ãã°ã¤ã³ãè¡ããããããã¯ãUNIXv1å ã§ã®ä½æ¥ã«ç§»ãã以éã¯ããã¯ã¹ãã¼ã¹ãå¹ããªããã注æãããã¨ãããééããå ´åã@ãè¡æ«ã«è¿½å ãEnterãæ¼ããã¨ã§å ¥åãç¡å¹åãããã¨ãã§ããã
login: root root # ls -@ #
ã»ããã¢ããã¹ã¯ãªããã¨å®è¡
tmpãã£ã¬ã¯ããªã«ç§»åãã
chdir tmp
cat ã³ãã³ããå©ç¨ããset.shãä½æãããchdir /ã§å§ã¾ãå 容ãå ¥åããã«ã¯ã¯ãªãããã¼ãã使ç¨ããã°è¯ããã¾ããå ¥åå¾ã«æ¹è¡ãã¦ããCtrl-dãæ¼ãã°ç¢ºå®ããã
# cat >set.sh chdir / chmod 017 tmp ls -al chdir /usr chown 6 ken ls -al chdir /usr/src/lib as crt0.s; mv a.out crt0.o mv crt0.o /usr/lib/crt0.o #
set.shãå®è¡ããã
# sh set.sh
set.shã§ãã£ã¦ãããã¨
ã»ããã¢ããã¹ã¯ãªããã§å®è¡ãã¦ãããã¨ã説æããã
tmpãã£ã¬ã¯ããªã®æ¨©éæ¸ãæã
ä¸è¬ã¦ã¼ã¶ã¼ã§ãedã³ãã³ãçãå©ç¨ã§ããããã«tmpãã£ã¬ã¯ããªã®æ¨©éãå¤æ´ãããrootã¦ã¼ã¶ã¼ã§tmpãã£ã¬ã¯ããªã®æ¨©éãå¤æ´ããã
# chdir / # chmod 017 tmp
ls -alã使ã£ã¦æ¨©éãå¤æ´ããããã確èªããã
# ls -al ... 114 sdrwrw 2 root 120 Jan 1 00:00:00 tmp ...
/usr/kenã®ææè ã®å¤æ´
kenãã£ã¬ã¯ããªå ã§ã¦ã¼ã¶ã¼kenã«ãããªãã¤ã¬ã¯ããå©ç¨ã§ããããã«ããããã®ããã«/usr/kenã®ææè ãrootããkenã«å¤æ´ããããã¡ãã§ããrootã¦ã¼ã¶ã¼ã§ææè ãå¤æ´ããã
# chdir /usr # chown 6 ken
ls -alã使ã確èª
# ls -al ... 57 sdrwr- 2 ken 70 Jan 1 00:00:00 ken ...
Cè¨èªã®å®è¡èµ·åã«ã¼ãã³ã®æºå
/usr/src/lib/crt.sããã«ããé©åãªå ´æã«é ç½®ããå¿ è¦ããããã¾ãã/usr/src/libã«ç§»åããã
# chdir /usr/src/lib
次ã«ããã«ããããã
# as crt0.s; mv a.out crt0.o
æå¾ã«ãã¢ã»ã³ãã«ãããã¡ã¤ã«ã/usr/libã«é ç½®ããã
# mv crt0.o /usr/lib/crt0.o
Cè¨èªãåä½ããã確èª
次ã®ä½æ¥ãããããã«Ctrl-dãæ¼ããã°ã¢ã¦ãããããããã¨ãããã³ãããã§ã¦ãããããããã«kenã¨å ¥åãã¦ã¼ã¶ã¼kenã§ãã°ã¤ã³ããããã®å¾ãcatã³ãã³ããå©ç¨ãã½ã¼ã¹ãã¡ã¤ã«ãä½æããã
@ cat >hello.c
ãã®ã³ãã³ããå ¥åããæç¹ã§å ¥åå¾ ã¡ã«ãªãããã以ä¸ã®ã³ã¼ããå ¥åããã
@ cat >hello.c main(){ extern printf; printf("hello UNIXv1\n"); return; }
å ¥åå¾ã¯æ¹è¡ãããCtrl-dãæ¼ããã¨ã§ç¢ºå®ããããã®å¾ãã³ã³ãã¤ã«ãããã
@ cc hello.c
ãã®éãã³ã³ãã¤ã«ã§ãã¦ããã°ã»ããã¢ããã¯å®äºã§ãããå®è¡ãã¡ã¤ã«ã§ããa.outãã¡ã¤ã«ãçæãããã®ã§å®è¡ããã
@ a.out hello UNIXv1
åæ¢ã®ããæ¹
Ctrl-eãæ¼ããã¨ã§simhã®ã³ãã³ãã¢ã¼ãã«ç§»è¡ããã
# Simulation stopped, PC: 007332 (MOV (SP)+,25244) sim>
ããã§quitã³ãã³ããå ¥åãããã¨ã§çµäºããã
# Simulation stopped, PC: 007332 (MOV (SP)+,25244) sim> quit Goodbye %SIM-INFO: RF: writing buffer to file: rf0.dsk
æå¾ã«
ä»åã¯ãUNIXv1ãã¨ãã¥ã¬ã¼ã¿ã§å®è¡ããããã®ç°å¢æ§ç¯ã«é¢ãã¦è§£èª¬ãããä»ã«ãdockerã¤ã¡ã¼ã¸ãªã©ãå ¬éããã¦ãããã調ã¹ã¦ã¿ã¦ã»ããã次åã¯ãUNIXv1ã®æä½æ¹æ³ã«é¢ãã¦ã®è¨äºãäºå®ãã¦ããã
次å
æªå ¬é
ManjaroLinux-KDEã®ã¡ã¢-ï¼
ç®æ¬¡
gitç¨ã®sshçæ
ssh-keygen -t rsa -b 4096 -C "<githubã«ç»é²ããã¡ã¼ã«ã¢ãã¬ã¹>"
åè
èªä½OSã«é¢ããè¨äºã®ãªã³ã¯
ã¯ããã«
ããã¡ããæ´çãã¦ã¨ããã£ãããããã¦ãã
ç®æ¬¡
ãã¼ããããã³ã«
multiboot2
bootboot
Stivale1 Stivale2
SMBIOS
Wiki
UEFIã ã¨GUIDã§éãããããã¢ã³ã«ã¼ãã¡ã¢ãªä¸ãæ¢ãå¿ è¦ã¯ãªãã
ä»æ§æ¸
2.xã¨3.xã«ã¯éããããã®ã§æ³¨æ www.dmtf.org
å®è£ ã«é¢ããåèè³æ
LibGetSmbiosStringé¢æ°ãè¦ãã¨ããããããã¨ã¯ãä»æ§æ¸ã§double nullã«é¢ãã¦èª¿ã¹ãã
ããããªOS
GitHubã¨ãã§å®è£ ãæ¢ãã¦ãæã«è¦ã¤ãããã¤
learn-os
EggOS
Goè¨èªã®x86ã«ã¼ãã«(gccgoãããªãã£ã½ãï¼çãã)
TomatOS
skiftOS
ãã«ãæã®æ³¨æ
Minoca OS
CurrOS
luakernel
FlorenceOS
Zigè¨èªã§æ¸ããã¦ãã£ã½ã
MITTOS64
Suckless Operating System
ClamAVã¡ã¢
ç¾å¨ä½ã£ã¦ãããã¼ããã¼ãã«é¢ãã¦
Table of Contents
- ã¯ããã«
- ã©ã®ãããªãã¼ããã¼ããç®æãã¦ããã®ãï¼
- ç¾å¨ã®è¦ãç®
- åä½ã«é¢ãã¦
- ã©ã®ããã«ãããï¼
- å¦ã«å¼ã£ããã£ãç®æ
- ä»å¾ã«é¢ãã¦
- æ¸ãçµãã¦
ã¯ããã«
ã¡ãªã¼ã¯ãªã¹ãã¹ï¼é©å½ã«å ¥ãããã¯ãªã¹ãã¹ã¤ãæ å½ã¨ãªã£ãç«(1010)ã§ããã¡ãªã¿ã«ã¯ãªã¹ãã¹ã¯ã¢ããã³ãã«ã¬ã³ãã¼ãæ¸ãã¦ãå¤æ¹ã«ã»ãã¥ãªãã£ãã£ã³ãã®ãã¼ã ã¨Rustå ¥éããããæ·±å¤ã«VRChatãããã¨ãã£ãæãã§ãããå å®ãã¦ãããã ããã¦ãªããã ã…ã
ä»åãç´ãã¦ãæè¿ã®è¿æ³ã¨ããã¾ããä»å¹´ã¯è²ã å¤åããã£ãå¹´ã§ãããããããããçµããã¨ãªãã¨ææ ¨æ·±ããã®ãããã¾ãã11æãããããã»ãã¥ãªãã£ã»ãã£ã³ãå ¨å½å¤§ä¼2020onlineã«Yãã©ãã¯OSèªä½ã¼ãã¨ãã¦åå ããã¦ãã¾ãããåããããªè¶£å³ã®æ¹ã«ã§ãããã¨ãã§ãã¦é常ã«æ¥½ããçµé¨ã ã£ããã¨ãè¦ãã¦ãã¾ããã¾ããã»ãã¥ãªãã£ãã£ã³ããéãã¦ãã¼ããã¼ããä½æãã¦ãã¾ãããã»ãã¥ãªãã£ã»ãã£ã³ãä¸ã«ã¯å®æã¯ããªãã£ãã®ã§ããï¼è¨ç»æ§ã®ç ´ç¶»ï¼ãæéä¸ã«ä½ãããã®ã¤ã¡ã¼ã¸ã¯ã¤ããã®ã§ï¾ï½®ï½ºï¾ï½®ï½ºä½æ¥ããã¦ããã¾ãã
ã©ã®ãããªãã¼ããã¼ããç®æãã¦ããã®ãï¼
- ãããã
- ã§ããéãã®æ å ±ããã£ãã確èªã§ãã
- ELFå½¢å¼ã®ã«ã¼ãã«ããã¼ã
ããããéæã§ããã¨ãããªãã¨èããªããä½æããã¦ãã¾ãã
ç¹ã«ã§ããéãã®æ å ±ããã£ãã確èªã§ããã¨ããç¹ã«é¢ãã¦ã¯ã以åãããã¼ããã¼ããスッ…ã¨çµãã£ã¦ãã¾ãããã¼ããã¼ãã¼ä½ãã£ã¨ããï¼ã¨ãã£ãæè¦ã«ãªã£ã¦ããã¨ããã®ãçç±ã¨ãã¦ããã¾ããè¦ã¯Linuxã®ãã¼ãæã®ãã°ã®ããã«è¡¨ç¤ºã§ããã°é¢ç½ããã£ã¦ãã¨ã§ãããã§ãããLinuxã®ãã°ã表示ãæ©ãããããªããæ²ããã§ããã¾ããã°ãã¡ã¤ã«ãæ®ãã¨ããã°æ©ãã¦ãããã ããã¨ããæè¦ããã¼ãæã«é ãã£ãããã«ãã¨èããã¨ç解ã§ãã¾ããã§ãããèªä½ã®ãã¼ããã¼ãã¼ããããã£ããè¦ããã®ã§ã!
ãã¨ã¯ãéçºããã«ãããã¯ããã¯ãã«ã¹ã¯ã©ããã§æ¸ããã¨ãã¦ãã¾ãããã§ããããããã¼ãã¡ã¤ã«ãæ¸ãã®ãçµæ§å¤§å¤ã¨ãããã¨ããããç¾å¨ã§ã¯EDK2ã使ã£ã¦ãã¾ãã
ç¾å¨ã®è¦ãç®
ãã®ãããªæãã§ãLinux風ã®ãã°ã表示ãã¾ããå¤ãã£ã¦ããç¹ã¨ãã¦ã¯ãELFãããã®å
容ãä¸é¨è¡¨ç¤ºããã¦ããç¹ã§ãããç¾ç¶ã¨ãã¦ã¯æ®éã®èªä½ã®ãã¼ããã¼ãã§ãåºåãã¦ããå
容ã«è¿ãã§ãããè²ãå¤æ´ããããã¦ãããããããããã¨ã¨æ
å ±ã®éãå¢ããã¦ãããã¨èãã¦ãã¾ããã¾ãããã´ã«é¢ãã¦ã¯ã¢ã¹ãã¼ã¸ã§ãã¬ã¼ã¿ã§çæãããã®ãPrint()ã§æç´ã«è¡¨ç¤ºãããã¦ãã¾ãã
ã¡ãªã¿ã«ãåç»ãã¼ã¸ã§ã³ã¯ä»¥ä¸ã«
ç¾ç¶ï¾ï¾ï¾...(æå¾Satll()å ¥ããã®å¿ãããªï¼) pic.twitter.com/iWIAyC90uk
— ç«(1010) (@Wagahaiha_toto) 2020å¹´12æ24æ¥
åä½ã«é¢ãã¦
ãã©ã®ãããªãã¼ããã¼ããç®æãã¦ããã®ãï¼ãã§ãè¿°ã¹ã¾ãããã表示ããã£ããè¦ããã¨ãã§ããããã«ç»é¢åºåã®åéã«Stall()ãå©ç¨ãã¦æéå·®ãã¤ãã¦ãã¾ããã¾ãã'''Kernel boot(press RET)'''ã®ç®æã§ã¯ãRetrunãæ¼ãã¨å¦çãå§ã¾ãããã«ãã¦ãã¾ãã
ã©ã®ããã«ãããï¼
ããããã®èª¿æ´ã¯ã»ãã¨ã«æç´ã«ããã¾ããã
表示ã®é 延ã«é¢ãã¦
以ä¸ã®ããã«ãã¦ãã¾ã
SystemTable->BootServices->Stall(n);
nã®ç®æããã¤ã¯ãç§ã¨ãã¦ä»è¾¼ãã§ããããã¨ã§é 延ãèµ·ãããã¨ãã§ãã¾ããèªåã¯ã500000ã«ãã¦ãã¾ãã
statusã®ã¿ã®è²ãå¤ãããã¨ã«é¢ãã¦
SetAttribute()ãå©ç¨ãã¦è²ãå¤ãã¦ãã¾ããã
SystemTable->ConOut->SetAttribute(SystemTable->ConOut, EFI_LIGHTRED);
ä¸è¨ã³ã¼ãä¾ã§ã¯ãã©ã¤ãã¬ããã®è²åãè²åãã«ãã¦ãã¾ãããã®EFI_LIGHTREDã¯ããããããã¨ã«EDK2å´ã§å®ç¾©ããã¦ãã
edk2/MdePkg/Include/Protocol/SimpleTextOut.h
ã«ã¦å®ç¾©ããã¦ãã¾ããgit grepã³ãã³ãçã§æ¢ãã°æ©ããã¨æãã¾ãã
ãã´ã®è¡¨ç¤ºã«é¢ãã¦
ããã¯ä»¥ä¸ã®URLå
ã®ASCIIã¸ã§ãã¬ã¼ã¿ãå©ç¨ãã¦çæãããã®ãPrint()ã§åºåããã¦ãã¾ãã
partorjk
ããã使ã£ã¦ä»¥ä¸ã®ããã«ãåºåãããã¨è¡¨ç¤ºã§ãã¾ããã
Print(L" __ __ __ ______ ______ \n"); Print(L"/ | _ / | / | / \\ / \\ \n"); Print(L"$$ | / \\ $$ | _______ ______ _$$ |_ /$$$$$$ |/$$$$$$ |\n"); Print(L"$$ |/$ \\$$ | / | / \\ / $$ | $$ | $$ |$$ \\__$$/ \n"); Print(L"$$ /$$$ $$ |/$$$$$$$/ $$$$$$ |$$$$$$/ $$ | $$ |$$ \\ \n"); Print(L"$$ $$/$$ $$ |$$ | / $$ | $$ | __ $$ | $$ | $$$$$$ |\n"); Print(L"$$$$/ $$$$ |$$ \\_____ /$$$$$$$ | $$ |/ |$$ \\__$$ |/ \\__$$ |\n"); Print(L"$$$/ $$$ |$$ |$$ $$ | $$ $$/ $$ $$/ $$ $$/ \n"); Print(L"$$/ $$/ $$$$$$$/ $$$$$$$/ $$$$/ $$$$$$/ $$$$$$/ \n"); Print(L" \n"); Print(L" \n"); Print(L" \n");
ããã§æ³¨æããã¹ããªã®ã¯ã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ã§ããããã ããä¸ã¤ãã¤ä¿®æ£ããã¨è¯ãæãã¨ãªãã¾ãã
å¦ã«å¼ã£ããã£ãç®æ
ã¦ã©ããããã°ã¿ã¤ãã®ç¡å¹åå¿ã
Qemuãæ¾ã£ã¦ããã¨ã5åãã¨ã«åèµ·åãèµ·ããã¦ããä¸æè°ã ã£ãã®ã§ãããã¦ã©ããããã°ã¿ã¤ããç¡ å¹åãããã¨ã§è§£æ±ºãã¾ããã
SystemTable->BootServices->SetWatchdogTimer(0, 0, 0, NULL);
ä»å¾ã«é¢ãã¦
ä»å¾ã¯é¸æç»é¢ãå®è£ ãããã¨èãã¦ãã¾ããClearscreenã¨printãé«éã§ç¹°ãè¿ããã¨ã§å®è£ ãããã¨ãã¤ã¡ã¼ã¸ãã¦ãããæåã¯UEFI shellã«è¡ããé¸æè¢ã¨ã«ã¼ãã«ãã¼ãã®é¸æè¢ããããã¼ã®é¸æè¢ãä½æãããã§è¿·ã丅ããã¨ã¯ãmemorymapã®åå¾ã¾ã§å®è£ ãå®äºãã¦ããã®ã§ãExitBootServices()å¨è¾ºãå®è£ ãã¦ãããã°åãããªã¨èãã¦ãã¾ãã
æ¸ãçµãã¦
æ°ã¥ãã人ã¯å°ãªãããããã¯ããªããããããªãã§ããããã¤ãã®ããã°ã®æ¸ãæ¹ã¨ã¯å°ãä½è£ãç°ãªã£ã¦ãã¾ãããã®çç±ã¯ãemacsã®org-modeã§ä½æããorgãã¡ã¤ã«ãmark-downã«å¤æããå¾ã«ã¯ã¦ãªããã°ã«è²¼ã£ã¤ãã微調æ´ããããããªãã§ããããããããã¦ãç§ã¯emacsã«çæ ½ãããããã«ã«ã¹ã¿ãã¤ãºãã¾ãããã¨ã好ããªã®ããªãã¨ãæããªããã¢ããã³ãã«ã¬ã³ãã¼ãæ¸ãã¦ãã¾ããã