Skip to content

drunkbatya/DrunkPC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

106 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A picture of DrunkPC

DrunkPC

Emulator

You can try it out on web emulator: https://drunkbatya.github.io/DrunkPC Emulator idea is inspired by @alemorf

About

This is a simple Zilog Z80-based portable computer consists of only 7 chips. It was a my childhood's dream - to make my own computer, to get the answer for question "how does it works?".

Features

  • Self-Updater!! (from CompactFlash card)
  • RA6963 driver (both text and graphics mode, incl. custom fonts)
  • AT28C526 write driver (page/byte writes, proper end of cycle monitoring)
  • CompactFlash (IDE) driver (read/write sectors, LBA)
  • Keyboard driver
  • Command line arguments parsing (by ' ' sep)
  • Text viewer (with scroll down and up!!)
  • JS emulator for testing in browser

Supported commands

List

  • msbasic - a port of Microsoft Basic 4.7
  • update - do a whole firmware update from CF card
  • uname - basic Unix uname with the full subset of args
  • less - simple basic Unix less, but now with only one test builtin file
  • test_app - for test cmd line args parsing (argc, argv)
  • cf_info - prints an identity CompactFlash info
  • snake - a raw Sanake Game (work in progress)

Specs

  • 240x64 Winstar RA6963-based sunlight-readable graphic display
  • Zilog Z80 CPU
  • 48k RAM (AS6C1008)
  • 16k ROM (AT28C256 flash chip)
  • On-board 59-key keyboard
  • 5 AH Li-Po battery with on-board charger and DC-DC step-up
  • No interrupts, memmory banking, context switching, built-in GPIO, timers etc.

This display controller is disigned to be connected directly to the 8080-style data bus (separate R/W pins). The keyboard is conneted to the buses via 74-series logic (line decoder and buffer).

Schematics, Gerber, BOM and other PickAndPlace files located in hardware directory.

Building

To build OS for this source you need a binutils compiled for target z80-elf, and other tools like make etc. Compiling is tested only on UNIX-like operating systems. I'm using binutils-z80-elf Docker image in Github CI.

Compiling binutils

    wget https://ftp.gnu.org/gnu/binutils/binutils-2.45.tar.xz
    tar -xvf binutils-2.45.tar.xz
    cd binutils-2.45
    ./configure --target=z80-elf

Compiling OS

To compile OS main images (.elf, .hex, .bin) just type:

    make

To compile an update image use:

    make updater_image

To compile both OS and updater images for emulator use:

    make emulator_dist

Updating

First download updater image from releases, or compile it:

git checkout 1.0.2
cd software
make updater_image

Then flash it to CF card

dd if=build/firmware_updater_cf_image.img of=CF_CARD_BLOCK_DEVICE_NOT_A_PARTITION

Insert a CF card, power on the DrunkPC, ensure CF card is working typing cf_info, then type update and follow the update process

About

Operating system for homemade 8-bit Z80 computer

Resources

License

Stars

Watchers

Forks

Contributors