### Update and Install Packages Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/vm-display-fbdev/Armbian-Notes.txt Updates the package list and upgrades existing packages, then installs a set of development and utility packages required for the system. This includes build tools, libraries for graphics and networking, and configuration utilities. ```bash sudo apt-get update && sudo apt-get upgrade sudo apt-get install fbset mg git binutils gdb libtool make libevdev2 libevdev-dev libcurl4-openssl-dev libssl-dev pkg-config zlib1g-dev libtiff-opengl libgl-dev libgl1-mesa-dev libgles2-mesa-dev libglade2-dev libglapi-mesa armbian-config ``` -------------------------------- ### Set Up Build Directory Next to Source Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.html/HowToBuildFromSource-node3.html Creates a 'bld' directory adjacent to the 'platforms' directory, which is a common and convenient setup for the build process. ```shell cd squeak ls mkdir bld cd bld ``` -------------------------------- ### Install VM, Plugins, and Manual Pages Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.html/HowToBuildFromSource-node3.html Installs the compiled VM, plugins, and manual pages to their respective system locations. Requires root privileges. ```shell su root make install ``` -------------------------------- ### Squeak VM Command Example Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.html/HowToBuildFromSource-node4.html An example of invoking the Squeak VM executable with an image file, typically used to start the Squeak environment or run specific tools like VMMaker. ```squeak squeak MyCoolPlugin.image ``` -------------------------------- ### Setting Up APT Sources and Installing Git Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/building/linux64riscv/LicheePiHow2.txt Steps to update the APT package list and install essential development tools like Git. This involves adding Debian RISC-V ports to `sources.list` and installing the necessary keyring. ```bash # Edit /etc/apt/sources.list dpkg -i debian-ports-archive-keyring_2022.02.15_all.deb sudo apt-get update sudo apt-get install git dillo ``` -------------------------------- ### Create and Navigate to Build Directory Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.html/HowToBuildFromSource-node3.html Sets up a dedicated directory for building the Squeak VM and navigates into it. This is the initial step in the compilation process. ```shell mkdir blddir cd blddir ``` -------------------------------- ### Configure Squeak Environment Variables Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/vm-display-fbdev/Armbian-Notes.txt Sets environment variables in the .bashrc file to configure the Squeak VM for framebuffer display. It defines the keyboard device, Squeak VM type, framebuffer device, mouse device, and paths to Cuis Smalltalk and the Squeak executable. ```bash export SQUEAK_KBDEV=/dev/input/event0 export SQUEAK_VM=display-fbdev export SQUEAK_FBDEV=/dev/fb0 export SQUEAK_MSDEV=/dev/input/event1 export CUIS=/home/kend/Cuis-Smalltalk/Cuis-Smalltalk-Dev export WORK=/home/kend/fbdev-vm/platforms/unix/vm-display-fbdev export SQUEAK=/home/kend/fbdev-vm/products/sqcogspur64ARMv8linuxht/lib/squeak/5*/squeak ``` -------------------------------- ### Install VM, Plugins, and Manual Pages Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.txt Installs the compiled VM, plugins, and manual pages to their designated system locations. This command typically requires superuser privileges (e.g., using 'sudo'). ```shell sudo make install ``` -------------------------------- ### Install Essential Packages (Alpine Linux) Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/vm-display-fbdev/AlpineLinux-Notes.txt Installs a set of essential packages for system administration, development, and graphical support on Alpine Linux using the apk package manager. Includes tools like git, bash, build tools, and X.org related packages. ```shell sudo apk add mg bash git lsblk sudo htop sudo apk add binutils build-base perl gdb libtool sudo apk add mandoc mandoc-apropos man-pages sudo apk add xf86-input-evdev xf86-input-evdev-doc xf86-input-evdev-dev sudo apk add xf86-video-fbdev xf86-video-fbdev-doc sudo apk add linux-rpi-dev linux-rpi4-dev linux-headers sudo apk add libevdev-dev glib-dev glu-dev openssl-dev ``` -------------------------------- ### Boot Bochs from Floppy Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/processors/IA32/bochs/docs-html/Linux.html Command to start the Bochs emulator, configured to boot from the floppy drive (device 'a'). This initiates the RedHat 5.0 installation sequence within the emulator. ```shell unix-> bochs boot:a ``` -------------------------------- ### Run Configure Script Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.html/HowToBuildFromSource-node3.html Executes the configure script to set up the build environment. It checks system dependencies and prepares Makefiles. Run './configure --help' for a full list of options. ```shell ../platforms/unix/config/configure ``` -------------------------------- ### Build VM and Plugins Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.html/HowToBuildFromSource-node3.html Compiles the Virtual Machine and its associated plugins. Use 'make squeak' to build only the VM or 'make plugins' to build only the plugins. ```shell make ``` -------------------------------- ### Mpeg3Plugin Makefile Configuration Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.html/HowToBuildFromSource-node5.html Example Makefile.in configuration for the Mpeg3Plugin, demonstrating how to specify plugin objects, include directories, C++ definitions, and link targets. ```makefile # Makefile.in for Mpeg3Plugin in Unix Squeak [make_cfg] [make_plg] TARGET = Mpeg3Plugin$a PLUGIN = Mpeg3Plugin$o VIDEO = getpicture$o headers$o idct$o macroblocks$o etc... AUDIO = dct$o header$o layer1$o layer2$o layer3$o etc... LIBMPEG = bitstream$o changesForSqueak$o libmpeg3$o etc... OBJS = $(PLUGIN) $(VIDEO) $(AUDIO) $(LIBMPEG) XINCLUDES = [includes] XDEFS = -DNOPTHREADS $(TARGET) : $(OBJS) Makefile $(LINK) $(TARGET) $(OBJS) [make_targets] .force : ``` -------------------------------- ### System Configuration and Networking Setup Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/building/linux64riscv/LicheePiHow2.txt Steps to configure networking on the Lichee RV Debian image. This involves editing configuration files for Wi-Fi credentials and network interfaces, followed by rebooting and using Connman for setup. ```bash # Edit /etc/wifi/wpa_supplicant.config for Wi-Fi credentials # Edit /etc/network/interfaces as per instructions # Reboot # Use Connman from menu->settings to set up Wifi # Use "gear" to auto-htpd # Reboot again ``` -------------------------------- ### Custom Makefile.in Template Example Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.txt Provides a complete Makefile template that replaces the default one generated by mkmf. This example shows how to define targets, objects, include paths, definitions, and build rules for a specific plugin (Mpeg3Plugin), including custom library dependencies. ```Makefile # Makefile.in for Mpeg3Plugin in Unix Squeak [make_cfg] [make_plg] TARGET = Mpeg3Plugin$a PLUGIN = Mpeg3Plugin$o VIDEO = getpicture$o headers$o idct$o macroblocks$o AUDIO = dct$o header$o layer1$o layer2$o layer3$o LIBMPEG = bitstream$o changesForSqueak$o libmpeg3$o OBJS = $(PLUGIN) $(VIDEO) $(AUDIO) $(LIBMPEG) XINCLUDES = [includes] XDEFS = -DNOPTHREADS $(TARGET) : $(OBJS) Makefile $(LINK) $(TARGET) $(OBJS) [make_targets] .force : ``` -------------------------------- ### Read and Display Video Frames Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/Cross/plugins/Mpeg3Plugin/examplesSqueak.txt This snippet shows how to open an MPEG file, set a specific starting frame, and read subsequent video frames into a Form. It iterates through frames, displays them on the screen, and includes a halt condition after processing a set number of frames. It's noted that better code exists in a player, but this serves as an example. ```Smalltalk | foo x y counter fum frames stream | foo _ MPEGFile openFile: 'randomalien.mpg'. stream _ 0. counter _ 0. y _ foo videoFrameHeight: stream. x _ foo videoFrameWidth: stream. fum _ Form extent: x@y depth: 32. frames _ foo videoFrames: stream. foo videoSetFrame: 700 stream: stream. [foo endOfVideo: stream] whileFalse: [ foo videoReadNextFrameInto: fum bits width: fum width height: fum height stream: stream. fum displayOn: Display. (counter _ counter + 1) == 50 ifTrue: [self halt]]. foo closeFile. ``` -------------------------------- ### Makefile Target Rule Example Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.html/HowToBuildFromSource-node5.html Shows a typical rule for building an object file from a source file using the $(COMPILE) command. This rule is part of the [make_targets] section. ```makefile name$o : original/source/dir/name.c $(COMPILE) name$o original/source/dir/name.c ``` -------------------------------- ### Basic VM Generation Workflow Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.html/HowToBuildFromSource-node4.html Steps to generate VM and plugin sources using VMMaker. This involves starting Squeak, using VMMakerTool to configure, generating sources, and then building the VM. ```shell ls squeak MyCoolPlugin.image # Open VMMakerTool and modify setup # Click 'generate ...' button configure; make; make install ``` -------------------------------- ### Configure with Specific Source Directory Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.html/HowToBuildFromSource-node3.html Configures the build process, specifying a particular VMMaker source directory using the --with-src option. This is useful when multiple source versions are present. ```shell .../configure --with-src=src-3.2gamma-4857 ``` ```shell .../configure --with-src=src-3.3alpha-4881 ``` -------------------------------- ### Compile and Run C++ Program Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/processors/IA32/bochs/docs-html/Linux.html Demonstrates basic post-installation steps within the RedHat 5.0 environment. It shows how to compile a C++ source file ('hello.cc') using GCC and then execute the resulting program. ```shell [root@bochs /root]# gcc -c hello.cc [root@bochs /root]# ./a.out ``` -------------------------------- ### Bochs Disk Image Setup Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/processors/IA32/bochs/doc/docbook/misc.txt Instructions for setting up disk images for Bochs, focusing on specifying cylinders, heads, and sectors per track (spt) in the bochsrc file. ```APIDOC Disk Image Configuration: - In DiskCopy, choose "Custom..." from the image size menu. - Select to enter size in "blocks" (Mac block is similar to a sector). - Enter the total number of sectors required. - Ensure the image is "Read/Write", not "Read Only". - Configure 'cyl=', 'heads=', and 'spt=' settings in the 'bochsrc' file. - After setup, a utility like "fdisk" may be needed to make the image readable. ``` -------------------------------- ### Simple Video Playback with MPEGPlayer Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/Cross/plugins/Mpeg3Plugin/examplesSqueak.txt This example demonstrates a straightforward way to play video from an MPEG file using MPEGPlayer. It initializes a Form for video output and then plays the video stream, waiting until it finishes. ```Smalltalk | foo | form _ Form extent: 320@240 depth: 32. foo _ MPEGPlayer playFile: 'randomAlien.mpg' onForm: form. foo playVideoStreamWaitTilDone: 0. ``` -------------------------------- ### Initialize Git Hooks and Versioning Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/CONTRIBUTING.md This command must be run after cloning the repository to install Git hooks and filters. These hooks automatically update SCCSVersion.h files with revision information during commits and merges. ```bash ./scripts/updateSCCSVersions ``` -------------------------------- ### Platform Build Directories Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/README.md Details the standard naming convention for platform-specific build directories and provides examples for Linux, macOS, and Windows. ```File Path building/linux32x86 building/macos32x86 building/macos64x64 building/win32x86 ``` -------------------------------- ### Checkout Squeak VM Source Code Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.txt Downloads the Squeak VM source code from the Subversion repository. This command requires an SVN client to be installed and configured on your system. ```shell svn co http://squeak.hpl.hp.com/svn/squeak/trunk squeak ``` -------------------------------- ### Bochs Repeat Iteration and Execution Callbacks Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/processors/IA32/bochs/instrument/instrumentation.txt Callbacks related to instruction execution flow, including the start of a new repeat iteration and events before/after instruction execution. ```APIDOC bx_instr_repeat_iteration(unsigned cpu, bxInstruction_c *i); - Description: Called at the start of each new repeat iteration for an instruction. - Parameters: - cpu: The CPU core identifier. - i: Pointer to the current instruction context. bx_instr_before_execution(unsigned cpu, bxInstruction_c *i); - Description: Called before the execution of any instruction. - For repeat instructions, called only once before the first iteration. - Parameters: - cpu: The CPU core identifier. - i: Pointer to the current instruction context. bx_instr_after_execution(unsigned cpu, bxInstruction_c *i); - Description: Called after the execution of any instruction. - For repeat instructions, called only once after all repeat iterations. - Parameters: - cpu: The CPU core identifier. - i: Pointer to the current instruction context. ``` ```C void bx_instr_repeat_iteration(unsigned cpu, bxInstruction_c *i); void bx_instr_before_execution(unsigned cpu, bxInstruction_c *i); void bx_instr_after_execution(unsigned cpu, bxInstruction_c *i); ``` -------------------------------- ### Set Input Device Permissions Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/vm-display-fbdev/Armbian-Notes.txt Changes the group ownership of input device files to 'input'. This is often necessary to allow non-root users or specific applications to access input devices like keyboards and mice. ```bash sudo chgrp input /dev/input/* ``` -------------------------------- ### Expanding SD Card Storage and Mounting /usr Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/building/linux64riscv/LicheePiHow2.txt Instructions for partitioning a larger SD card, formatting the new partition, copying existing `/usr` content, and updating `/etc/fstab` to mount the new partition as `/usr` on boot. This provides more space for software installation and building. ```bash # Use fdisk to delete partition 8 and create a new one sudo mkfs.ext4 /dev/sda8 # Copy contents of /usr to the new partition sudo cp -rup /usr /mnt/new_usr # Add to fstab for mounting on boot # /dev/mmcblk0p8 /usr ext4 rw,defaults 0 2 # After reboot, mount the new /usr partition ``` -------------------------------- ### Configure Squeak VM Environment Variables Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/vm-display-fbdev/AlpineLinux-Notes.txt Sets environment variables in .bashrc to simplify launching the Squeak VM. These variables define the keyboard device, VM display mode, framebuffer device, and mouse device, allowing a shorter command to start the VM. ```shell # in .bashrc # to allow 'squeak " # rather than 'squeak -vm-display-fbdev -fbdev /dev/fb0 ' SQUEAK_KBDEV=/dev/input/event0 SQUEAK_VM=display-fbdev SQUEAK_FBDEV=/dev/fb0 SQUEAK_MSDEV=/dev/input/event1 ``` -------------------------------- ### Creating and Enabling Swap File Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/building/linux64riscv/LicheePiHow2.txt Instructions to create a 1GB swap file for systems with limited RAM (like 512MB). This involves using `dd` to create the file, `mkswap` to format it, and updating `/etc/fstab` to enable it on boot. ```bash sudo dd if=/dev/zero of=/usr/swap bs=1M count=1024 status=progress sudo mkswap /usr/swap # Add to fstab # /usr/swap none swap defaults 0 0 sudo swapon -a ``` -------------------------------- ### Mount RedHat 5.0 CD on Linux Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/processors/IA32/bochs/docs-html/Linux.html Instructions for mounting the RedHat 5.0 installation CD-ROM on a Linux system. This is a prerequisite for the installation script to access the necessary installation files. ```shell linux-root> mount /mnt/cdrom ``` -------------------------------- ### Building OpenSmalltalk VM Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/building/linux64riscv/LicheePiHow2.txt Commands to clone the OpenSmalltalk VM repository and build it for the RISC-V architecture. This includes navigating to the build directory and executing the build script. ```bash cd /usr/build git clone --depth 1 https://github.com/KenDickey/opensmalltalk-vm-rv64 cd opensmalltalk-vm-rv64/building/linux64riscv/squeak.stack.spur/build ./mvm ``` -------------------------------- ### CMake: Install VM Targets and Fix Cygwin Permissions Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/CMakeLists.txt Installs the VM targets (libraries, executables, plugins) to the specified installation prefix. Includes logic to fix incorrect file permissions for DLLs and EXEs on Cygwin environments by generating and installing a helper script. ```cmake install(TARGETS ${VM_LIBRARY_NAME} ${VM_EXECUTABLE_TARGETS} ${VM_EXTERNAL_PLUGINS_TARGETS} ARCHIVE DESTINATION ${ProductInstallProgramFolder} LIBRARY DESTINATION ${ProductInstallProgramFolder} RUNTIME DESTINATION ${ProductInstallProgramFolder} PUBLIC_HEADER DESTINATION ${ProductInstallBaseFolder}/include PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE ) # HACK: On cygwin the resulting dlls and exe file are having wrong # permissions. if(MINGW_ON_CYGWIN) set(FIX_CYGWIN_INSTALL_PERMISSIONS_BASH_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/FixCygwinInstallPermissions.sh") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/FixCygwinInstallPermissions.sh.in" "${FIX_CYGWIN_INSTALL_PERMISSIONS_BASH_SCRIPT}" @ONLY) set(FIX_CYGWIN_INSTALL_PERMISSIONS_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/FixCygwinInstallPermissions.cmake") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/FixCygwinInstallPermissions.cmake.in" "${FIX_CYGWIN_INSTALL_PERMISSIONS_SCRIPT}" @ONLY) install(SCRIPT "${FIX_CYGWIN_INSTALL_PERMISSIONS_SCRIPT}") endif() ``` -------------------------------- ### Squeak VM Command-Line Options Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/vm-display-Quartz/Resources/SqueakHelp/SqueakHelp.html Provides information on how to launch the Squeak VM from the command line and access its various features. Specific options control display behavior and help information. ```APIDOC Squeak VM Command-Line Interface: General Usage: Squeak can be started from the command line to access features not available when launched from the Finder. Options can control behavior like running without a window. Display Options: -quartz Forces the Squeak VM to use the Quartz display system. -display Forces the Squeak VM to use the X11 display system. Requires X11 libraries (libX11, libXext) to be installed on the client machine for remote display connections. Help Option: -help Lists all available command-line options. Note that display-specific options must precede '-help' for their options to be included (e.g., '-quartz -help'). Example: To see Quartz-specific options: ./Squeak.app/Contents/MacOS/Squeak -quartz -help To see X11-specific options: ./Squeak.app/Contents/MacOS/Squeak -display :0.0 -help ``` -------------------------------- ### VM Build Process for JIT Simulation Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/README.md Outlines the steps to build a VM suitable for full JIT simulation. This involves building support code for the specific platform and then building a Squeak.cog.spur VM. ```APIDOC Building VM for Full JIT Simulation: 1. Build support code in the appropriate top-level subdirectory for your platform. 2. Build a Squeak.cog.spur VM in the sibling directory. ``` -------------------------------- ### RedHat 5.0 Boot Prompt Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/processors/IA32/bochs/docs-html/Linux.html The expected prompt during the RedHat 5.0 installation when booting from the floppy. Entering 'rescue' allows access to a minimal Linux environment for system recovery or installation. ```shell boot: rescue [Return] ``` -------------------------------- ### Run RedHat 5.0 Installation Script Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/processors/IA32/bochs/docs-html/Linux.html This section details how to execute the 'install_redhat50' script, located in the bochs-YYMMDD/misc directory. The script prepares the hard disk image for RedHat 5.0 installation. ```shell linux-root> cd bochs-YYMMDD/misc linux-root> ./install_redhat50 ``` -------------------------------- ### CMake: Status Message for Installation Prefix Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/CMakeLists.txt Prints a status message indicating the final installation prefix for the build artifacts. This is a common practice in CMake to inform the user where the installed files will be located. ```cmake message(STATUS "Build results can be installed to ${CMAKE_INSTALL_PREFIX}") ``` -------------------------------- ### Explore MPEG File Properties Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/Cross/plugins/Mpeg3Plugin/examplesSqueak.txt Demonstrates how to open an MPEG file, query its properties like audio/video presence, channel count, sample rate, frame dimensions, and seek through the file. It also shows how to set specific playback parameters like CPU usage for video decoding. ```Smalltalk | foo | foo _ MPEGFile openFile: 'randomalien.mpg'. foo hasVideo. foo hasAudio. foo endOfVideo: 0. foo endOfAudio: 0. foo audioChannels: 0. foo audioSamples: 0. foo audioGetSample: 0. foo audioSampleRate: 0. foo videoFrameRate: 0. foo videoGetFrame: 0. foo audioGetSample: 0. foo getTimeCode. foo videoPreviousFrame: 0. foo videoSetCPUs: 1. foo videoSetFrame: 44 stream: 0. foo setMMX: true. foo audioSetSample: 44 stream: 0. foo totalAudioStreams. foo totalVideoStreams. foo videoFrames: 0. foo videoFrameHeight: 0. foo videoFrameWidth: 0. foo seekPercentage: 0.5. foo getPercentage. foo videoSetCPUs: 1. foo setMMX: true. foo closeFile. ``` -------------------------------- ### Install LILO Bootloader Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/processors/IA32/bochs/docs-html/Linux.html This command installs the LILO bootloader onto the mounted hard disk image. It's crucial for making the system bootable directly from the hard drive in subsequent Bochs sessions. ```shell # /mnt/sbin/lilo -r /mnt ``` -------------------------------- ### Unmount Hard Drive Image Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/processors/IA32/bochs/docs-html/Linux.html After installing the bootloader, this command unmounts the hard disk image from the temporary directory, ensuring data integrity before shutting down the emulator. ```shell # umount /mnt ``` -------------------------------- ### Configure Build Environment Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.txt Runs the configure script to set up the build environment for the Squeak VM. It detects system specifics and prepares Makefiles. Use '--help' for options. ```shell ../platforms/unix/config/configure ``` -------------------------------- ### Copy Supplementary Floppy Image Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/processors/IA32/bochs/docs-html/Linux.html During the installation, the system prompts for the supplementary floppy disk. This command copies the pre-created supplementary floppy image to the working file for the emulator. ```shell unix-> cp 1.44_redhat_sup 1.44 ``` -------------------------------- ### Boot Bochs from Hard Drive Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/processors/IA32/bochs/docs-html/Linux.html Command to restart the Bochs emulator, configured to boot from the hard drive (device 'c'). This assumes the LILO bootloader has been successfully installed. ```shell unix-> bochs boot:c ``` -------------------------------- ### Instrumentation Start Callback Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/processors/IA32/bochs/docs-html/cosimulation.html The `instr_start` function pointer is called when the user enters the command `instrument start` at the debug prompt. This allows the instrumentation package to initialize itself and begin collecting data. ```APIDOC void (*instr_start)(void); // Only defined if macro BX_INSTRUMENTATION is 1 Description: Callback function invoked when instrumentation is explicitly started. Purpose: To initialize the instrumentation package and begin data collection when requested by the user via the debug prompt. Condition: This function is only defined and available if the `BX_INSTRUMENTATION` macro is enabled (set to 1). ``` -------------------------------- ### Build VM and Plugins Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.txt Compiles the Squeak Virtual Machine and its associated plugins. This is the primary command to initiate the build process after navigating to the correct directory. ```shell make ``` -------------------------------- ### Create RedHat Floppy Images on Linux Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/processors/IA32/bochs/docs-html/Linux.html This snippet shows how to create image files from physical floppy disks (boot and supplementary) on a running Linux system. These images are essential for the Bochs installation process. ```shell # stick in Boot disk linux-> cp /dev/fd0 1.44_redhat_boot # stick in Supplementary disk linux-> cp /dev/fd0 1.44_redhat_sup ``` -------------------------------- ### OpenSmalltalk VM Build Process Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.txt Commands for configuring, building, and updating the OpenSmalltalk VM. This includes initial configuration, updating the build environment after changes, and recompiling the configure script. ```shell $ squeak MyCoolPlugin.image ... generate new sources ... $ cd blddir $ ./config.status $ make ``` ```shell $ make -C ../platforms/unix/config ``` -------------------------------- ### MacBochs Port Status and Setup Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/processors/IA32/bochs/doc/docbook/misc.txt Documentation regarding the experimental Macintosh port of Bochs. It details the status as of December 1998, setup instructions using CodeWarrior, and known issues. This information is historical and may require significant updates for modern macOS versions. ```APIDOC MacBochs Port Status and Setup Status: Experimental Macintosh port of Bochs. Compiles under CodeWarrior Pro R1 (CW12). Capable of booting Win95 in command-line mode and running DOS programs. A CodeWarrior project ("Bochs.proj") is included. NOTE: MacBochs is a "work in progress", much code is incomplete. Preliminary version for developers to contribute or test. Updates: - 23 Dec 98: Updated to bochs-981222. Noticeably faster. Implemented Bochs headerbar. Added support for ejecting floppy disks (click Drive A: icon or Cmd-E). - 17 Dec 98: Added real floppy disk support. Optimized graphics screen drawing. Keyboard support still broken (needs KCHR resources and KeyTranslate()). How to Set up MacBochs: 1. Compile Bochs (PPC, 68k or FAT) or obtain a pre-compiled binary. Use the included CodeWarrior project. 2. Create a hard disk image: - Bochs requires a hard disk image to boot. - Use DiskCopy to create a folder image. - DO NOT ENTER DISK SIZE IN MEGABYTES. - Refer to "install.html" in "docs-html" for disk size/geometry tables and total SECTORS required. Problems: - Keyboard support is broken and needs overhaul. - Testing with "clean" Windows installer disks is recommended to rule out SoftWindows-specific driver interference. Other Issues: - Code moved: macutils.h to osdep.h, macutils.c to osdep.cc (Bryce Denney, 4/5/2001). - Historical note: Original macintosh.txt is obsolete, needs significant hacking for modern macOS. ``` -------------------------------- ### Build Unix Squeak VM Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.html/HowToBuildFromSource-node2.html This section details the commands required to build, install, and clean the Unix Squeak virtual machine and its associated plugins. It assumes the source code has been obtained and is located in a directory named 'squeak'. ```shell # Example of checking out from repository svn co http://squeak.hpl.hp.com/svn/squeak/trunk squeak # Change to the unix directory cd squeak/platforms/unix # Build the VM and plugins make # Install the VM, plugins, and manual pages (requires superuser privileges) sudo make install # Delete temporary build files make clean ``` -------------------------------- ### Custom C++ Definitions Example Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.html/HowToBuildFromSource-node5.html Shows how to define custom C++ preprocessor definitions, such as -DNOPTHREADS, within a Makefile to influence compilation. ```c++ XDEFS = -DNOPTHREADS ``` -------------------------------- ### Framebuffer Support Configuration Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/building/linux64riscv/LicheePiHow2.txt Steps to enable framebuffer support for graphical output. This involves installing `evtest` and `libevdev`, potentially recompiling the `vm-display-fbdev` plugin, and setting environment variables for input and display devices. ```bash sudo apt-get install evtest libevdev # If build breaks, cd vm-display-fbdev; make; cd ..; ./mvm # Set environment variables in .bashrc: export SQUEAK_KBDEV=/dev/input/event6 export SQUEAK_VM=display-fbdev export SQUEAK_FBDEV=/dev/fb0 export SQUEAK_MSDEV=/dev/input/event3 ``` -------------------------------- ### Bochs Instruction Cache Control Definitions Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/processors/IA32/bochs/instrument/instrumentation.txt Definitions for instruction cache control operations within the Bochs simulator. ```C #define BX_INSTR_INVD 20 #define BX_INSTR_WBINVD 21 ``` -------------------------------- ### Flashing Debian Image to SD Card Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/building/linux64riscv/LicheePiHow2.txt Command to flash a Debian image to an SD card using `dd`. Ensure the output device (`/dev/sda`) is correctly identified to avoid data loss on other drives. ```bash sudo dd if=20211230_LicheeRV_debian_d1_hdmi_8723ds.ddimg of=/dev/sda bs=4M status=progress conv=sync ``` -------------------------------- ### Bochs Physical Memory Access Callbacks Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/processors/IA32/bochs/instrument/instrumentation.txt Callbacks providing feedback from the external memory system for physical read and write operations. ```APIDOC bx_instr_phy_read(unsigned cpu, bx_address addr, unsigned len); - Description: Callback for physical memory read operations. - Parameters: - cpu: The CPU core identifier. - addr: The physical address being read. - len: The number of bytes being read. bx_instr_phy_write(unsigned cpu, bx_address addr, unsigned len); - Description: Callback for physical memory write operations. - Parameters: - cpu: The CPU core identifier. - addr: The physical address being written to. - len: The number of bytes being written. ``` ```C void bx_instr_phy_read(unsigned cpu, bx_address addr, unsigned len); void bx_instr_phy_write(unsigned cpu, bx_address addr, unsigned len); ``` -------------------------------- ### Change to Build Directory Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.txt Navigates into the newly created build directory. All subsequent build commands will be executed from this location. ```shell cd blddir ``` -------------------------------- ### Plugin Configuration Macros Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.html/index.html Details on Autoconf macros used for configuring plugins within the Squeak build system. These macros help manage library checks and define specific keywords for plugin integration. ```APIDOC AC_PLUGIN_CHECK_LIB(lib, func) - Checks for the presence of a library and a specific function within it. - Parameters: - lib: The name of the library to check. - func: The name of the function to look for within the library. - Purpose: Ensures necessary libraries are available for the plugin. AC_PLUGIN_DEFINE_UNQUOTED(keyword, text) - Defines a keyword with its associated text, unquoted. - Parameters: - keyword: The keyword to define. - text: The unquoted text value for the keyword. - Purpose: Used for defining specific configuration parameters or identifiers for plugins. ``` -------------------------------- ### Bochs I/O Port Access Callbacks Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/processors/IA32/bochs/instrument/instrumentation.txt Callbacks reporting input (IN) and output (OUT) operations to I/O ports, used for simulating device interactions. ```APIDOC bx_instr_inp(Bit16u addr, unsigned len); - Description: Callback for IN instruction to an I/O port. - Parameters: - addr: The 16-bit I/O port address. - len: The number of bytes being read. bx_instr_outp(Bit16u addr, unsigned len); - Description: Callback for OUT instruction to an I/O port. - Parameters: - addr: The 16-bit I/O port address. - len: The number of bytes being written. bx_instr_inp2(Bit16u addr, unsigned len, unsigned val); - Description: Alternate callback for IN instruction, potentially with value. - Parameters: - addr: The 16-bit I/O port address. - len: The number of bytes being read. - val: The value read (if applicable). bx_instr_outp2(Bit16u addr, unsigned len, unsigned val); - Description: Alternate callback for OUT instruction, potentially with value. - Parameters: - addr: The 16-bit I/O port address. - len: The number of bytes being written. - val: The value being written. ``` ```C void bx_instr_inp(Bit16u addr, unsigned len); void bx_instr_outp(Bit16u addr, unsigned len); void bx_instr_inp2(Bit16u addr, unsigned len, unsigned val); void bx_instr_outp2(Bit16u addr, unsigned len, unsigned val); ``` -------------------------------- ### Makefile.inc for Null Platform Support Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/doc/HowToBuildFromSource.html/HowToBuildFromSource-node5.html Illustrates the creation of an empty Makefile.inc file to provide 'null' platform support for a plugin, a common workaround for VMMaker requirements. ```makefile # Makefile.inc for Mpeg3Plugin in Unix Squeak # This file can be empty to provide 'null' platform support. # It is placed in the plugin's platdep directory. ``` -------------------------------- ### Create Topic Branch from Cog Source: https://github.com/opensmalltalk/opensmalltalk-vm/blob/Cog/CONTRIBUTING.md Quickly create a new topic branch based on the 'Cog' branch for your contribution. This is the standard starting point for most new work. ```git git checkout -b feature/Cog/my_contribution Cog && git push -u origin feature/Cog/my_contribution ```