Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
en:manual:contrib:hbbsd_devel_guidelines [2024/01/20 12:47]
emulatorman
en:manual:contrib:hbbsd_devel_guidelines [2024/01/20 18:36]
emulatorman
Line 30: Line 30:
 </note> </note>
  
-Mount the root **FFS2** as secondary device:<code bash>+Mount the root **FFS2** as secondary device: 
 + 
 +<code bash>
 # mkdir hbbsd_dir/ # mkdir hbbsd_dir/
 +</code>
 +
 +<code bash>
 # mount /dev/sd1a hbbsd_dir/ # mount /dev/sd1a hbbsd_dir/
 </code> </code>
  
-Mount a primary **EXT2** as third device:<code bash>+Mount a primary **EXT2** as third device: 
 +<code bash>
 # mkdir ext2_dir/ # mkdir ext2_dir/
-# mount /dev/sd2i ext2_dir/</code>+</code> 
 + 
 +<code bash> 
 +# mount /dev/sd2i ext2_dir/ 
 +</code>
  
 ===== Getting the source code and building the kernel (HyperBK) ===== ===== Getting the source code and building the kernel (HyperBK) =====
Line 49: Line 59:
  
   * Install **GCC** and **Binutils** for HyperbolaBSD cross compilation.<code bash>   * Install **GCC** and **Binutils** for HyperbolaBSD cross compilation.<code bash>
-    $ TARCH=x86_64-unknown-hyperbolabsd+    $ TARCH=x86_64-unknown-hyperbolabsd</code><code bash>
     $ doas pacman -S $TARCH-gcc $TARCH-binutils</code>     $ doas pacman -S $TARCH-gcc $TARCH-binutils</code>
   * Install **BSD make** and **Athena Jot**.<code bash>   * Install **BSD make** and **Athena Jot**.<code bash>
Line 56: Line 66:
     $ git clone https://git.hyperbola.info:50100/hyperbolabsd/hyperbk.git</code>     $ git clone https://git.hyperbola.info:50100/hyperbolabsd/hyperbk.git</code>
   * Access the directory **hyperbk/arch/amd64/compile/GENERIC.MP**:<code bash>   * Access the directory **hyperbk/arch/amd64/compile/GENERIC.MP**:<code bash>
-    $ KARCH=amd64 KCFG=GENERIC.MP+    $ KARCH=amd64 KCFG=GENERIC.MP</code><code bash>
     $ cd hyperbk/arch/$KARCH/compile/$KCFG; unset KARCH KCFG</code>     $ cd hyperbk/arch/$KARCH/compile/$KCFG; unset KARCH KCFG</code>
   * Copy the directory **obj_gen** to **obj**:<code bash>   * Copy the directory **obj_gen** to **obj**:<code bash>
Line 63: Line 73:
     $ cd obj</code>     $ cd obj</code>
   * Make the //HyperbolaBSD// kernel //("bmake install" to install this kernel)//:<code bash>   * Make the //HyperbolaBSD// kernel //("bmake install" to install this kernel)//:<code bash>
-    $ NTHREADS=2 +    $ NTHREADS=2</code><code bash> 
-    $ bmake -j $NTHREADS CC=$TARCH-cc LD=$TARCH-ld+    $ bmake -j $NTHREADS CC=$TARCH-cc LD=$TARCH-ld</code><code bash>
     $ unset CC LD NTHREADS TARCH</code>     $ unset CC LD NTHREADS TARCH</code>
  
 Steps to clean source code:<code bash> Steps to clean source code:<code bash>
-    $ KARCH=amd64 KCFG=GENERIC.MP +    $ KARCH=amd64 KCFG=GENERIC.MP</code><code bash> 
-    $ cd hyperbk/arch/$KARCH/compile/$KCFG; unset KARCH KCFG+    $ cd hyperbk/arch/$KARCH/compile/$KCFG; unset KARCH KCFG</code><code bash>
     $ bmake clean</code>     $ bmake clean</code>
  
Line 90: Line 100:
  
   * Install **GCC** and **Binutils** for HyperbolaBSD cross compilation.<code bash>   * Install **GCC** and **Binutils** for HyperbolaBSD cross compilation.<code bash>
-    $ TARCH=x86_64-unknown-hyperbolabsd+    $ TARCH=x86_64-unknown-hyperbolabsd</code><code bash>
     $ doas pacman -S $TARCH-gcc $TARCH-binutils</code>     $ doas pacman -S $TARCH-gcc $TARCH-binutils</code>
-  * Install **BSD make**, **rpcsvc-proto**, **Sharutils** \\ and **Universal Ctags**.<code bash>+  * Install **BSD make**, **rpcsvc-proto**, **Sharutils** and **Universal Ctags**.<code bash>
     $ doas pacman -S bmake rpcsvc-proto sharutils ctags</code>     $ doas pacman -S bmake rpcsvc-proto sharutils ctags</code>
   * Clone this repository:<code bash>   * Clone this repository:<code bash>
-    $ URL=https://git.hyperbola.info:50100 +    $ URL=https://git.hyperbola.info:50100</code><code bash> 
-    $ git clone $URL/hyperbolabsd/userspace-alpha.git+    $ git clone $URL/hyperbolabsd/userspace-alpha.git</code><code bash>
     $ unset URL</code>     $ unset URL</code>
   * Install **OpenBSD lorder**.<code bash>   * Install **OpenBSD lorder**.<code bash>
-    $ cd userspace-alpha +    $ cd userspace-alpha</code><code bash> 
-    $ doas cp usr.bin/lorder/lorder.sh /usr/local/bin/lorder +    $ doas cp usr.bin/lorder/lorder.sh /usr/local/bin/lorder</code><code bash> 
-    $ doas chown 0:0 /usr/local/bin/lorder+    $ doas chown 0:0 /usr/local/bin/lorder</code><code bash>
     $ doas chmod 0755 /usr/local/bin/lorder</code>     $ doas chmod 0755 /usr/local/bin/lorder</code>
   * Prepare the **HyperBK™** source code:<code bash>   * Prepare the **HyperBK™** source code:<code bash>
Line 109: Line 119:
  
   * Make the //HyperbolaBSD// kernel //("bmake install" to install this kernel)//:<code bash>   * Make the //HyperbolaBSD// kernel //("bmake install" to install this kernel)//:<code bash>
-    $ NTHREADS=2 +    $ NTHREADS=2</code><code bash> 
-    $ bmake -m $PWD/share/mk -j $NTHREADS CC=$TARCH-cc LD=$TARCH-ld+    $ bmake -m $PWD/share/mk -j $NTHREADS CC=$TARCH-cc LD=$TARCH-ld</code><code bash>
     $ unset CC LD NTHREADS TARCH</code>     $ unset CC LD NTHREADS TARCH</code>
  
 Steps to clean source code:<code bash> Steps to clean source code:<code bash>
-    $ cd userspace-alpha +    $ cd userspace-alpha</code><code bash> 
-    $ bmake -m $PWD/share/mk clean+    $ bmake -m $PWD/share/mk clean</code><code bash>
     $ bmake -f obj.mk clean</code>     $ bmake -f obj.mk clean</code>
  
Line 143: Line 153:
  
 <code bash> <code bash>
-$ qemu-img create obsd.img 2.2G+$ qemu-img create obsd.img 2.2G</code><code bash>
 $ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name OpenBSD -net nic -net user,id=port1,hostfwd=tcp::2022-:22 -s -hda install70.img -hdb obsd.img -netdev user,id=mynet0,hostfwd=tcp:127.0.0.1:7922-:22 -device virtio-net,netdev=mynet0</code> $ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name OpenBSD -net nic -net user,id=port1,hostfwd=tcp::2022-:22 -s -hda install70.img -hdb obsd.img -netdev user,id=mynet0,hostfwd=tcp:127.0.0.1:7922-:22 -device virtio-net,netdev=mynet0</code>
  
Line 202: Line 212:
  
 <code bash> <code bash>
-$ qemu-img create ext2.img 5G+$ qemu-img create ext2.img 5G</code><code bash>
 $ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name OpenBSD -net nic -net user,id=port1,hostfwd=tcp::2022-:22 -s -hda openbsd.img -hdb ext2.img -netdev user,id=mynet0,hostfwd=tcp:127.0.0.1:7922-:22 -device virtio-net,netdev=mynet0</code> $ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name OpenBSD -net nic -net user,id=port1,hostfwd=tcp::2022-:22 -s -hda openbsd.img -hdb ext2.img -netdev user,id=mynet0,hostfwd=tcp:127.0.0.1:7922-:22 -device virtio-net,netdev=mynet0</code>
  
 <code bash> <code bash>
-# newfs_ext2fs -IO 1 sd1c+# newfs_ext2fs -IO 1 sd1c</code><code bash>
 # halt -p</code> # halt -p</code>
  
Line 220: Line 230:
  
 <code bash> <code bash>
-$ cd /usr +$ cd /usr</code><code bash> 
-$ cvs -qd anoncvs@anoncvs.ca.openbsd.org:/cvs checkout -rOPENBSD_7_0 -P src +$ cvs -qd anoncvs@anoncvs.ca.openbsd.org:/cvs checkout -rOPENBSD_7_0 -P src</code><code bash> 
-$ cvs -d anoncvs@anoncvs.spacehopper.org:/cvs checkout -P src +$ cvs -d anoncvs@anoncvs.spacehopper.org:/cvs checkout -P src</code><code bash> 
-Are you sure you want to continue connecting (yes/no)? yes+Are you sure you want to continue connecting (yes/no)? yes</code>
  
 +<code bash>
 nano /usr/src/sys/sys/disklabel.h: nano /usr/src/sys/sys/disklabel.h:
 --- ---
 -#define       DOSPTYP_OPENBSD 0xa6            /* OpenBSD partition type */ -#define       DOSPTYP_OPENBSD 0xa6            /* OpenBSD partition type */
 +#define       DOSPTYP_OPENBSD 0x6a            /* HyperbolaBSD partition type */ +#define       DOSPTYP_OPENBSD 0x6a            /* HyperbolaBSD partition type */
 +</code>
  
-# cd /usr/src/sys/arch/amd64/compile/GENERIC.MP +<code bash> 
-# make obj +# cd /usr/src/sys/arch/amd64/compile/GENERIC.MP</code><code bash> 
-# make config +# make obj</code><code bash> 
-# make +# make config</code><code bash> 
-# mount -t ext2fs /dev/sd1c /mnt +# make</code><code bash> 
-# cd /usr/obj/?? +# mount -t ext2fs /dev/sd1c /mnt</code><code bash> 
-# cp -va biosboot boot /mnt +# cd /usr/obj/??</code><code bash> 
-# umount /mnt+# cp -va biosboot boot /mnt</code><code bash> 
 +# umount /mnt</code><code bash>
 # halt -p</code> # halt -p</code>
  
Line 257: Line 270:
  
 <code bash> <code bash>
-# cd hbsd_base/var/sysmerge/etc_dir/ +# cd hbsd_base/var/sysmerge/etc_dir/</code><code bash> 
-# bsdtar cvozf ../etc.tgz --options gzip:compression-level=9 * +# bsdtar cvozf ../etc.tgz --options gzip:compression-level=9 *</code><code bash> 
-# cd .. +# cd ..</code><code bash> 
-# rm -r etc_dir +# rm -r etc_dir</code><code bash> 
-</code>+# cd hbsd_base/</code><code bash> 
 +# bsdtar cvzf ../hbbsd_base.tgz *</code>
  
-<code bash> 
-# cd hbsd_base/ 
-# bsdtar cvzf ../hbbsd_base.tgz * 
-</code> 
 ===== Adding HyperbolaBSD packages in install70.img ===== ===== Adding HyperbolaBSD packages in install70.img =====
  
 <code bash> <code bash>
-$ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name OpenBSD -net nic -net user,id=port1,hostfwd=tcp::2022-:22 -s -hda obsd.img -hdb install70.img -hdc ext2.img -netdev user,id=mynet0,hostfwd=tcp:127.0.0.1:7922-:22 -device virtio-net,netdev=mynet0</code> +$ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name OpenBSD -net nic -net user,id=port1,hostfwd=tcp::2022-:22 -s -hda obsd.img -hdb install70.img -hdc ext2.img -netdev user,id=mynet0,hostfwd=tcp:127.0.0.1:7922-:22 -device virtio-net,netdev=mynet0</code><code bash> 
- +# mkdir ext2_dir</code><code bash> 
-<code bash> +# mount /dev/sd1a /mnt</code><code bash> 
-# mkdir ext2_dir +# mount -t ext2fs /dev/sd2c ext2_dir</code><code bash> 
-# mount /dev/sd1a /mnt +# mkdir /mnt/hbbsd</code><code bash> 
-# mount -t ext2fs /dev/sd2c ext2_dir +# cp -va /mnt/7.0/amd64/INSTALL.amd64 /mnt/hbbsd</code><code bash> 
-# mkdir /mnt/hbbsd +# cd ext2_dir</code><code bash> 
-# cp -va /mnt/7.0/amd64/INSTALL.amd64 /mnt/hbbsd +# cp -va bsd bsd.mp bsd.rd /mnt/hbbsd</code><code bash> 
-# cd ext2_dir +# cp -va hbbsd_base.tgz /mnt/hbbsd/base70.tgz</code><code bash> 
-# cp -va bsd bsd.mp bsd.rd /mnt/hbbsd +# cd /mnt/hbbsd</code><code bash> 
-# cp -va hbbsd_base.tgz /mnt/hbbsd/base70.tgz +# sha256 * > SHA256</code><code bash> 
-# cd /mnt/hbbsd +# chmod 0644 *</code><code bash> 
-# sha256 * > SHA256 +# chmod 0755 bsd bsd.mp</code><code bash> 
-# chmod 0644 * +# chown build:2000 *</code><code bash> 
-# chmod 0755 bsd bsd.mp +# chown 0 INSTALL.amd64 bsd.rd</code><code bash> 
-# chown build:2000 * +# chown 0:wheel SHA256</code><code bash> 
-# chown 0 INSTALL.amd64 bsd.rd +# cd</code><code bash> 
-# chown 0:wheel SHA256 +# umount /mnt</code><code bash> 
-# cd +# umount ext2_dir</code><code bash> 
-# umount /mnt +# rmdir ext2_dir</code><code bash>
-# umount ext2_dir +
-# rmdir ext2_dir+
 # halt -p</code> # halt -p</code>
  
Line 297: Line 305:
  
 <code bash> <code bash>
-$ qemu-img create hbbsd_inst.img 2.2G+$ qemu-img create hbbsd_inst.img 2.2G</code><code bash>
 $ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name HyperbolaBSD -net nic -net user,id=port1,hostfwd=tcp::2022-:22 -s -hda install70.img -hdb hbbsd_inst.img -netdev user,id=mynet0,hostfwd=tcp:127.0.0.1:7922-:22 -device virtio-net,netdev=mynet0</code> $ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name HyperbolaBSD -net nic -net user,id=port1,hostfwd=tcp::2022-:22 -s -hda install70.img -hdb hbbsd_inst.img -netdev user,id=mynet0,hostfwd=tcp:127.0.0.1:7922-:22 -device virtio-net,netdev=mynet0</code>
  
Line 351: Line 359:
  
 What timezone are you in? ('?' for list) [Canada/Montain] Etc/UTC What timezone are you in? ('?' for list) [Canada/Montain] Etc/UTC
-</code> +</code><code bash> 
- +# halt -p</code>
-<code bash> +
-# halt -p +
-</code> +
- +
-<code bash> +
-$ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name HyperbolaBSD -net nic -net user,id=port1,hostfwd=tcp::2022-:22 -s -hda obsd.img -hdb hbbsd.img -hdc hbbsd_inst.img -netdev user,id=mynet0,hostfwd=tcp:127.0.0.1:7922-:22 -device virtio-net,netdev=mynet0</code> +
- +
-<code bash> +
-# mkdir hbbsd_dir +
-</code>+
  
 <code bash> <code bash>
 +$ qemu-system-x86_64 -machine q35 -cpu max -smp 2 -m 4G -device intel-hda -device hda-duplex -name HyperbolaBSD -net nic -net user,id=port1,hostfwd=tcp::2022-:22 -s -hda obsd.img -hdb hbbsd.img -hdc hbbsd_inst.img -netdev user,id=mynet0,hostfwd=tcp:127.0.0.1:7922-:22 -device virtio-net,netdev=mynet0</code><code bash>
 +# mkdir hbbsd_dir</code><code bash>
 # mount /dev/sd1a hbbsd_dir # mount /dev/sd1a hbbsd_dir
-</code> +</code><code bash>
- +
-<code bash>+
 # mount /dev/sd2a /mnt # mount /dev/sd2a /mnt
-</code> +</code><code bash>
- +
-<code bash>+
 # cd /mnt # cd /mnt
-</code> +</code><code bash>
- +
-<code bash>+
 # cp -va altroot bin bsd bsd.mp bsd.rd dev etc home mnt root sbin tmp usr var hbbsd_dir # cp -va altroot bin bsd bsd.mp bsd.rd dev etc home mnt root sbin tmp usr var hbbsd_dir
-</code> +</code><code bash>
- +
-<code bash>+
 # umount hbbsd_dir # umount hbbsd_dir
-</code> +</code><code bash>
- +
-<code bash>+
 # umount /mnt # umount /mnt
-</code> +</code><code bash>
- +
-<code bash>+
 # rmdir hbbsd_dir # rmdir hbbsd_dir
-</code> +</code><code bash> 
- +# halt -p</code>
-<code bash> +
-# halt -p +
-</code>+