Paolo Amoroso's Journal

ChromeOS

Working on Suite8080 and using the Z80MBC2 encouraged me to learn Intel 8080 and Z80 Assembly.

Now I'm dipping my toes into x86 Assembly, which I've always been curious about and attracted by. An additional motivation is discovering MikeOS, a lovely real-mode operating system in x86 Assembly that's surprisingly easy to read and understand.

Therefore, I put together an environment to cross-develop and run x86 code.

Requirements

My desktop daily driver is an ASUS Chromebox 3, with the Crostini Linux container of chromeOS that lets me run most Linux software. Any emulation and development tools must therefore be available for Linux.

Intel x86 Assembly is close enough to 8080 Assembly that x86 code looks familiar. To leverage this similarity and avoid the complexity of x86 segmentation, for the time being I want to develop 16-bit real-mode programs that fit into the single segment of a .COM executable.

The obvious choice for an operating system to run these programs is MS-DOS. Why? Because its rich environment strikes the right balance between complexity and functionality.

So the emulator must run a full MS-DOS environment and boot from media images. Which enables coding for the bare metal, a PC with no operating system.

As for the Assembly tools, I prefer to cross-develop on Linux. Although I'm a retrocmputing enthusiast, for writing and building code I want the convenience of a modern system.

MS-DOS emulation

QEMU would have been my first choice for x86 emulation but has compatibility issues with Crostini, as virtualizing in a virtual environment is tricky.

A bit of research led me to DOSBox-X, which runs fine on Crostini as it emulates rather than virtualize. DOSBox-X is a fork of DOSBox with a more fleshed out MS-DOS environment. Plus it can boot from media images.

DOSBox-X running under chromeOS on my Chromebox looks like this:

DOSBox-X session under chromeOS on an ASUS Chromebox 3.

Installing DOSBox-X on the Chromebox was straightforward. However, the Flatpak package carried almost a gigabyte worth of dependencies that nearly filled the Crostini file system. I had to resize the container from 7.5 to 10 GB to accommodate all the files and leave enough free space.

A feature I like is the emulator can mount a directory tree of the Linux file system as an MS-DOS disk. This is handy for quickly transferring cross-assembled binaries to MS-DOS.

DOSBox-X has rendering issues on chromOS, i.e. the menu bar and items flicker randomly. A workaround is to turn off the menu bar.

I tested DOSBox-X booting by checking out MikeOS, which runs well.

Assembly development

There's a vast assortment of x86 assemblers but I skipped the research by picking NASM for Linux.

I like this popular tool because it's rich of features and comes with extensive documentation. It also has a clean, non verbose syntax and can generate MS-DOS .COM programs.

To test the full cross-development and emulation toolchain I used NASM to assemble an x86 real-mode hello world demo, copied it to a directory DOSBox-X mounts as a disk, and ran it under MS-DOS. Success! A simple and low friction workflow.

#Assembly #MSDOS #chromeOS #retrocomputing #x86

Discuss... Email | Reply @amoroso@fosstodon.org

ChromeOS 104 delivered the ability to access USB serial devices from Android, an option for controlling the Z80-MBC2 computer from an Android terminal emulator app.

I didn't realize chromeOS 104 improved the support for accessing USB serial devices also from web apps implementing the WebUSB API. On my Chromebox, version 104 is the first that enables controlling the Z80-MBC2 from the web. Here's a CP/M 3.0 session in a serial terminal emulator web app:

USB Web Serial terminal emulator web app running a Z80-MBC2 CP/M 3.0 session on chromeOS.

Up to chromeOS 104, web terminals failed to connect to the Z80-MBC2 as they didn't detect the USB device. With version 104 I tested the following terminal apps, most of which work:

These apps operate the same way. A connection button brings up a system dialog listing the serial devices, like the Z80-MBC2's CP2102 chip. Once connected, the apps behave like other terminal emulators.

Although useful as an additional option for controlling the Z80-MBC2 on chromeOS, these web terminals are experimental or basic apps, have limited functionality, and miss major features like XMODEM file transfer.

#z80mbc2 #sbc #Android #chromeOS

Discuss... Email | Reply @amoroso@fosstodon.org

ChromeOS 104 landed on my Chromebox delivering a pleasant surprise, the ability to access serial USB devices from Android apps.

When I plugged the Z80-MBC2 Z80 homebrew computer into the Chromebox under chromeOS 104, the system popped up this notification allowing me to connect the device to Android or Linux, not just Linux as before:

chromeOS notification allowing to connect a Z80-MBC2 serial USB device to Linux or Android.

The notifcation confirms the detection of the Z80-MBC2's CP2102 chipset and says:

USB device detected

Open Settings to connect CP2102 USB to UART Bridge Controller to Linux or Android apps

Connect to Linux Connect to Android

I had long been looking forward to accessing the Z80-MBC2 from Android. I researched a great terminal emulator app, Serial USB Terminal, which can connect to serial USB devices, features basic ANSI support, and can transfer files via XMODEM. Although the app runs fine on the Chromebox, I never figured how to connect to the Z80-MBC2. It turns out it wasn't possible, until chromeOS 104.

Selecting the notification's option to connect to Android prompts to run Serial USB Terminal, optionally setting it as the default app for Android connections.

I interacted a bit with the Z80-MBC2 from the Android terminal emulator and it's usable. Here's what a CP/M 3.0 session looks like in the app in landscape tablet mode, the window layout that works best with a terminal:

Serial USB Terminal Android app running a Z80-MBC2 CP/M 3.0 session on chromeOS.

Input goes in a text field separate from the terminal output. It feels awkward on the desktop but natural on mobile devices with touch interfaces.

Serial USB Terminal's ANSI support seems limited or incomplete, but I haven't checked extensively.

I tried transferring a file via XMODEM from the terminal emulator to the Z80-MBC2 under CP/M 3.0. But, as with Crostini Linux, nothing happens and the XMODEM transfer doesn't work. More experimentation may provide clues on the XMODEM issue.

So far I haven't played with the Z80-MBC2 much from Android, but it's great to have another option for controlling the device.

#z80mbc2 #sbc #Android #chromeOS

Discuss... Email | Reply @amoroso@fosstodon.org

On my Chromebox, XMODEM file transfer from Linux to the Z80-MBC2 is broken, but I've been trying with every new chromeOS version just in case an update delivers a fix. So far the transfer still doesn't work with chromeOS up to 104.

#z80mbc2 #sbc #chromeOS

Discuss... Email | Reply @amoroso@fosstodon.org

Chrome OS 101 was supposed to prompt to upgrade Crostini, its Linux container subsystem, from Debian Buster to Bullseye. A 9to5Google article on Chrome OS 101 noted:

Linux on Chrome OS now uses Debian 11 (Bullseye) with upgrade prompts available in the Settings app for those on Debian 10 (Buster). You also now get an upgrade log that’s saved in the Downloads folder.

However, when Chrome OS Stable 101.0.4951.59 landed on my ASUS Chromebox 3 with Crostini running Buster, I got no such prompt. A comment by the user Mr. Smith on an About Chromebooks post about upgrading to Bullseye clarified the prompt is hidden behind a flag.

I went through the upgrade process Mr. Smith outlined and it worked, sort of. Here are the steps I took:

  1. enable the flag chrome://flags#crostini-bullseye-upgrade
  2. reboot Chrome OS
  3. accept the prompt to upgrade to Bullseye
  4. open the Terminal app
  5. run the following shell commands:

    $ sudo apt update
    $ sudo apt full-upgrade -y
    $ sudo apt -y autoremove
    

Sure enough, after rebooting the system I got the upgrade prompt, accepted it, and watched a dialog reporting on the upgrade progress. A dozen minutes later the process ended with the following errors:

Failed to connect to bus: No data available
Failed to connect to bus: No data available
invoke-rc.d: initscript sudo, action "restart" failed.
Failed to connect to bus: No data available
dpkg: error processing package sudo (--configure):
 installed sudo package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 sudo
E: Sub-process /usr/bin/dpkg returned an error code (1)

I'm not sure what triggered the errors. But a few quick checks of Crostini suggested the installed apps work and nothing major seems broken. Therefore, I'm leaving the container upgraded to Bullseye 11.3 as is and monitor it.

#chromeOS #Linux

Discuss... Email | Reply @amoroso@fosstodon.org

Although Linux had been my daily driver for almost two decades, when I switched to Chrome OS I regarded the Crostini Chrome OS Linux container mostly as a curiosity.

Sure, I was eager to have some fun with Linux on my Chromebox. But I already lived fully in the cloud and web apps met all my computing needs. I assumed the main use cases for Crostini were advanced development or DevOps.

To check out Crostini, I installed some astronomical image visualization and processing software for Linux. Next, I used Python preinstalled on Crostini to test the code I was writing with Repl.it and make sure it ran on a different system.

When I began working on Suite8080, a suite of Intel 8080 Assembly cross-development tools in Python, I needed some CP/M emulators and 8080 tools to test the Python programs I was developing, as well as my Assembly code. Again, installing and running such Linux software on Crostini worked well.

I came to love Crostini, now a key component of my Chrome OS toolset. It lets me run all sorts of niche applications and specialized software for my hobby projects and geeky interests.

#chromeOS #Linux

Discuss... Email | Reply @amoroso@fosstodon.org

Now that Chrome's reading list icon is next to the omnibar, I wondered whether I'd notice it and use the feature. Nope. To maximize the content area, I keep the reading list collapsed and the icon isn't prominent enough to notice.

So I'm back to my read later tool of choice: Google Keep.

#chromeOS

Discuss... Email | Reply @amoroso@fosstodon.org

I use exclusively Chrome OS on the desktop and store most data in my Google account. So Spinbackup is the best cloud-to-cloud backup and recovery tool for my needs.

It allows to back up the data from my Google account in Gmail, Google Drive, Google Photos, and other Google products. Spinbackup also supports personal Google accounts for individual use, is affordable, and lets me access the data even if I lose access to my Google account (don't take this feature for granted).

The product has a few rough edges though. Two-step verification comes with no backup codes. And there's no way of updating a payment method, other than canceling a subscription and purchasing it again with a different method.

#chromeOS

Discuss... Email | Reply @amoroso@fosstodon.org

The SkySafari 6 Plus astronomy app for Android still works on my Chromebook but no longer on my Chromebox. The app doesn't detect any Internet access despite the Chromebox being wired to a 1 Gbps fiber connection.

It's emblematic of Google never encouraging Android developers to adapt their apps to Chrome OS.

#chromeOS

Discuss... Email | Reply @amoroso@fosstodon.org

On Chrome OS, to maximize the content area I leave Chrome's bookmarks bar hidden.

This is also where the reading list icon sat, which is why I kept not noticing and using it. Chrome 99 moved the icon next to the omnibar, where it's always in view. I'm meaning to try the reading list and the new location will hopefully help me notice it.

#chromeOS

Discuss... Email | Reply @amoroso@fosstodon.org