From fca66172e8f6092f6a942c5871d415ca58831387 Mon Sep 17 00:00:00 2001 From: "tim.newsham" Date: Sun, 11 May 2008 02:00:34 +0000 Subject: [PATCH] - fix a bug in the sh.s code that was garbled in the printout. - now installing sh.s as /bin/sh in the rf0 image. --- build/Makefile | 2 +- notes/notes.txt | 5 +++++ pages/e11-01 | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build/Makefile b/build/Makefile index c183a75..80168c7 100644 --- a/build/Makefile +++ b/build/Makefile @@ -138,7 +138,7 @@ root usr protofs : init sh @$(TREECOPY) ../fs/new/etc root @$(TREECOPY) ../fs/usr . @cp init root/etc/init - @cp sh root/bin/xsh + @cp sh root/bin/sh @touch protofs # build filesystem images diff --git a/notes/notes.txt b/notes/notes.txt index d06837a..e212149 100644 --- a/notes/notes.txt +++ b/notes/notes.txt @@ -267,6 +267,11 @@ e11-01 - changed "cdpb B(r5),$'-" to "cmpb 8(r5),$'-" which seems like what the code is trying to do. Left the "calleZd" and "loginx~" typos in the comments as is. + - I compared this against the s2 binary for /bin/sh and the + code sequence looks similar. This instruction is + "cmpb @2(R5),#55" which properly does what the comments say. + It reads argv[0][0] and compares with '-'. Edited this + code to be in agreement. - uncommented string after "jsr r5, error" line since other calls to error are followed by literal strings. e11-02 diff --git a/pages/e11-01 b/pages/e11-01 index 711b774..f3c2a2f 100644 --- a/pages/e11-01 +++ b/pages/e11-01 @@ -1,7 +1,7 @@ / sh -- command interpreter mov sp,r5 mov r5,shellarg / save orig sp in shellarg - cmpb 8(r5),$'- / was this sh calleZd by init or loginx~ + cmpb *2(r5),$'- / was this sh calleZd by init or loginx~ bne 2f / no sys intr; 0 / yes, turn off interrupts sys quit; 0