Skip to content

redcode/Z80-LKM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Z80-LKM

Discord

This tiny project allows you to build the Z80 library as a Linux kernel module.

Build

Prerequisites

  • CMake v3.14 or later.
  • Linux kernel headers.

Configuration options

The CMake script supports the following options:

  • -DLINUX_KERNEL_HEADERS_DIR=<path>
    Specify the directory of the Linux kernel headers.
    If this option is not defined, the directory will be autodetected.
    Not defined by default.

  • -DZ80_LKM_STABLE=(YES|NO)
    Download the source code packages of the stable versions of Z80 and Zeta instead of cloning the master branch from their respective Git repositories.
    The default is NO.

Build

Type the following:

git clone https://github.com/redcode/Z80-LKM.git
mkdir Z80-LKM/build
cd Z80-LKM/build
cmake .. [options]
make

This will generate the z80.ko module, which then you can load and unload:

insmod z80.ko     # Load the module
dmesg | tail -n 1 # Will print "Zilog Z80 CPU emulator v0.2"
rmmod z80         # Unload the module

License

Copyright © 2022 Manuel Sainz de Baranda y Goñi.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.