mirror of
https://github.com/DoctorWkt/unix-jun72.git
synced 2026-04-03 12:43:15 +00:00
- cleaned up the build process some
- use patches instead of sed hacks. - comments for all patches, and each one separated. - apply patches as part of "rebuild" instead of in assemv7.
This commit is contained in:
11
patches/cold.patch
Normal file
11
patches/cold.patch
Normal file
@@ -0,0 +1,11 @@
|
||||
diff -ru rebuilt/u0.s build/u0.s
|
||||
--- rebuilt/u0.s 2008-05-03 08:27:03.000000000 -1000
|
||||
+++ build/u0.s 2008-05-04 08:29:31.000000000 -1000
|
||||
@@ -1,6 +1,6 @@
|
||||
/ u0 -- unix
|
||||
|
||||
-cold = 0
|
||||
+cold = 1
|
||||
orig = 0 . / orig = 0. relocatable
|
||||
|
||||
rkda = 177412 / disk address reg rk03/rk11
|
||||
12
patches/fixV7div.patch
Normal file
12
patches/fixV7div.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff -ru rebuilt/u0.s build/u0.s
|
||||
--- rebuilt/u0.s 2008-05-03 08:27:03.000000000 -1000
|
||||
+++ build/u0.s 2008-05-04 08:28:00.000000000 -1000
|
||||
@@ -122,7 +122,7 @@
|
||||
mov $sb0,(r1)+ / I/O queue entry drum
|
||||
mov $sb1,(r1)+ / I/O queue entry disk (mounted device)
|
||||
mov $swp,(r1)+ / I/O queue entry core image being swapped
|
||||
- mov $[systm-inode]\/2,sb0+4 / sets up initial buffers per
|
||||
+ mov $-109.,sb0+4 / sets up initial buffers per
|
||||
/ format given in
|
||||
mov $systm,sb0+6 / memory map
|
||||
mov $-512.,sb1+4
|
||||
23
patches/notes.txt
Normal file
23
patches/notes.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
cold.patch -
|
||||
Sets the "cold" flag to one to build a kernel that bootstraps the
|
||||
root filesystem.
|
||||
|
||||
fixV7div.patch
|
||||
The instruction
|
||||
mov $[systm-inode]\/2,sb0+4 / sets up initial buffers per
|
||||
assembles incorrectly with the v7 assembler we are using because
|
||||
it does an unsigned divide by two on a negative number. We patch
|
||||
the correct value "-109." in for the expression. This is fragile
|
||||
and will break if systm or inode move around due to code changes.
|
||||
|
||||
vec0407.patch
|
||||
The v7 assembler builds an 0407 a.out file. The original sources
|
||||
used an 0405 a.out file in which the a.out header occupied the first
|
||||
six words of the text segment. The sources accomodate this in two
|
||||
ways 1) they comment out the first 3 vectors. 2) they have code
|
||||
which patches those first six vectors back to their proper values.
|
||||
When building with the v7 assembler the first work around will
|
||||
result in the other vectors having an incorrect offset. This patch
|
||||
just uncomments the first three vectors. This would not be necessary
|
||||
if we had a proper 0405 assembler.
|
||||
|
||||
16
patches/vec0407.patch
Normal file
16
patches/vec0407.patch
Normal file
@@ -0,0 +1,16 @@
|
||||
diff -r -u rebuilt/u0.s build/u0.s
|
||||
--- rebuilt/u0.s 2008-05-03 08:27:03.000000000 -1000
|
||||
+++ build/u0.s 2008-05-04 08:25:41.000000000 -1000
|
||||
@@ -45,9 +45,9 @@
|
||||
core = orig+40000 / specifies beginning of user's core
|
||||
ecore = core+20000 / specifies end of user's core (4096 words)
|
||||
|
||||
-/ 4;4 init by copy
|
||||
-/ unkni;0 " error
|
||||
-/ fpsym;0 " illg in tr
|
||||
+ 4;4 / init by copy
|
||||
+ unkni;0 / " error
|
||||
+ fpsym;0 / " illg in tr
|
||||
unkni;0 / trace and trap (see Sec. B.1 page )
|
||||
unkni;0 / trap
|
||||
panic;0 / pwr
|
||||
@@ -9,31 +9,13 @@
|
||||
. tools/assemv7.cfg
|
||||
|
||||
export APOUT_ROOT
|
||||
COLD=0
|
||||
if [ "$1" = "cold" ] ; then
|
||||
COLD=1
|
||||
fi
|
||||
echo "COLD: $COLD"
|
||||
|
||||
tools/rebuild
|
||||
|
||||
# fix "mount" issue which 1ed as cant deal with
|
||||
# and also fix up the vector table in u0.s since
|
||||
# the result is a slightly different format a.out that doesnt
|
||||
# include the header in the text segment
|
||||
test -d build || mkdir build
|
||||
for f in rebuilt/u?.s ; do
|
||||
b=`basename $f`
|
||||
if [ $COLD = 1 ] ; then
|
||||
sed -e 's/.*init by copy.*/4;4;unkni;0;fpsym;0/' \
|
||||
-e 's/\[systm-inode\]\\\//-109./' \
|
||||
-e 's/cold = 0/cold = 1/' < $f > build/$b
|
||||
else
|
||||
sed -e 's/.*init by copy.*/4;4;unkni;0;fpsym;0/' \
|
||||
-e 's/\[systm-inode\]\\\//-109./' < $f > build/$b
|
||||
fi
|
||||
done
|
||||
# build sources from pages and generate patched sources in "build"
|
||||
# if "cold" is passed in, the "cold" option will be patched on.
|
||||
tools/rebuild "$@"
|
||||
|
||||
# assemble the kernel from patched sources and generate symbols
|
||||
# and build a simh loadable file.
|
||||
cd build
|
||||
$APOUT $APOUT_ROOT/bin/as ../sys1.s u?.s
|
||||
$APOUT $APOUT_ROOT/bin/nm a.out |sort > a.out.syms
|
||||
|
||||
@@ -1,19 +1,41 @@
|
||||
#!/bin/sh
|
||||
|
||||
m() { cat pages/$2 > rebuilt/$1.s; }
|
||||
r() { cat pages/$2-* > rebuilt/$1.s; }
|
||||
|
||||
test -d rebuilt || mkdir rebuilt
|
||||
rebuild() {
|
||||
test -d rebuilt || mkdir rebuilt
|
||||
|
||||
m u0 e00-*
|
||||
m u1 e01-*
|
||||
m u2 e02-*
|
||||
m u3 e03-*
|
||||
m u4 e04-*
|
||||
m u5 e05-*
|
||||
m u6 e06-*
|
||||
m u7 e07-*
|
||||
m u8 e08-*
|
||||
m u9 e09-*
|
||||
m ux e10-*
|
||||
#m sh e11-*
|
||||
#m ini e12-*
|
||||
echo rebuilding...
|
||||
r u0 e00
|
||||
r u1 e01
|
||||
r u2 e02
|
||||
r u3 e03
|
||||
r u4 e04
|
||||
r u5 e05
|
||||
r u6 e06
|
||||
r u7 e07
|
||||
r u8 e08
|
||||
r u9 e09
|
||||
r ux e10
|
||||
#r sh e11
|
||||
#r ini e12
|
||||
}
|
||||
|
||||
p() { echo ' ' $1; patch -s -p1 <../patches/$1; }
|
||||
|
||||
patches() {
|
||||
test -d build || mkdir build
|
||||
|
||||
echo patching...
|
||||
cp rebuilt/* build
|
||||
cd build
|
||||
p vec0407.patch
|
||||
p fixV7div.patch
|
||||
if [ "$1" = "cold" ] ; then
|
||||
p cold.patch
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
rebuild
|
||||
patches "$@"
|
||||
|
||||
Reference in New Issue
Block a user