├── crates ├── arduinox86_cpu │ ├── README.md │ ├── Cargo.toml │ ├── LICENSE │ ├── tests │ │ └── flags.rs │ └── examples │ │ └── cpu_id.rs ├── arduinox86_egui │ ├── README.md │ ├── assets │ │ └── icon-256.png │ ├── .gitignore │ ├── LICENSE │ ├── src │ │ ├── widgets │ │ │ └── mod.rs │ │ ├── controls │ │ │ └── mod.rs │ │ ├── config.rs │ │ ├── async_exec.rs │ │ ├── windows │ │ │ └── mod.rs │ │ ├── thread_event.rs │ │ ├── lib.rs │ │ ├── main.rs │ │ ├── range_check │ │ │ └── mod.rs │ │ ├── events.rs │ │ ├── resource_manager.rs │ │ └── scheduler.rs │ └── Cargo.toml ├── arduinox86_client │ ├── README.md │ ├── src │ │ ├── commands.rs │ │ └── registers │ │ │ └── mod.rs │ ├── Cargo.toml │ └── LICENSE ├── exec_program │ ├── Cargo.toml │ └── LICENSE └── test_generator │ ├── Cargo.toml │ └── src │ └── flags.rs ├── cfg └── arduinox86_gui.toml ├── shields ├── 486 │ └── kicad │ │ ├── sym-lib-table │ │ └── arduinox86_486_shield.kicad_prl ├── 80186 │ ├── kicad │ │ ├── .gitignore │ │ ├── sym-lib-table │ │ └── arduino_80186.kicad_prl │ └── README.md ├── 808x │ ├── kicad │ │ ├── .gitignore │ │ ├── sym-lib-table │ │ └── arduino_808x_v3.kicad_prl │ └── gerbers │ │ ├── ard8088-NPTH.drl │ │ ├── ard8088-Edge_Cuts.gm1 │ │ ├── ard8088-B_Paste.gbp │ │ ├── ard8088-F_Paste.gtp │ │ ├── ard8088-NPTH-drl_map.gbr │ │ └── ard8088-job.gbrjob ├── 808X_V3 │ ├── kicad │ │ ├── .gitignore │ │ ├── sym-lib-table │ │ └── ard8088.kicad_prl │ └── README.md ├── 386EX │ ├── images │ │ └── 386ex_hat.jpg │ ├── kicad │ │ ├── sym-lib-table │ │ └── arduino_386.kicad_prl │ └── README.md ├── 386EX_387SX │ ├── images │ │ ├── 387_render_01.png │ │ └── 387_schematic_01.png │ ├── kicad │ │ ├── sym-lib-table │ │ └── arduino_386_387.kicad_prl │ └── README.md ├── 386EX_V4 │ ├── images │ │ └── 386ex_v4_render_01.png │ ├── kicad │ │ ├── sym-lib-table │ │ └── arduino_386EX_V4.kicad_prl │ └── README.md ├── 387SX_V2 │ ├── kicad │ │ ├── sym-lib-table │ │ └── arduino_387SX_V2.kicad_prl │ └── README.md └── 286_5V │ ├── kicad │ ├── sym-lib-table │ └── arduino_286_5V.kicad_prl │ └── README.md ├── images ├── pcb_v1_1.png ├── render_v1_1.png ├── pcb_shield50.PNG ├── arduino8088_pcb.jpg ├── arduino8088_breadboard.jpg └── arduinox86_logo_transparent_01.png ├── platformio └── ArduinoX86 │ ├── src │ ├── src.ino │ ├── util.c │ ├── Vga.cpp │ ├── strings.cpp │ ├── buzzer.cpp │ ├── interrupts.cpp │ ├── globals.cpp │ ├── opcodes.h │ └── DebugPrint.cpp │ ├── asm │ ├── pop_cs.asm │ ├── loadall_386.asm │ ├── cpu_id.asm │ ├── loadall_386.lst │ ├── cpu_id.lst │ ├── cpu_setup_386ex.asm │ ├── cpu_setup_386ex.lst │ ├── load.asm │ ├── store_nmi.asm │ ├── store.asm │ └── store_nmi_386_real.asm │ ├── .gitignore │ ├── .vscode │ ├── extensions.json │ └── settings.json │ ├── test │ └── README │ ├── platformio.ini │ ├── lib │ └── README │ └── include │ ├── exceptions.h │ ├── interrupts.h │ ├── README │ ├── serial_config.h │ ├── Board.h │ ├── Display.h │ ├── shields │ ├── Pins.h │ └── ShieldTraits.h │ ├── Shield.h │ ├── CpuTypes.h │ ├── boards │ └── BoardTraits.h │ ├── programs.h │ ├── globals.h │ ├── bus_emulator │ ├── NullBackend.h │ └── IBusBackend.h │ ├── DebugFilter.h │ └── StaticHashTable.h ├── sketches └── cpu_server │ ├── asm │ ├── pop_cs.asm │ ├── cpu_id.asm │ ├── cpu_id.lst │ ├── load.asm │ ├── store_nmi.asm │ └── store.asm │ ├── buzzer.ino │ ├── BoardController.h │ ├── hats │ ├── Hat8088.h │ ├── HatTraits.h │ └── Hat80186.h │ ├── boards │ ├── BoardTraits.h │ ├── ArduinoDueBoard.h │ └── ArduinoGigaBoard.h │ ├── ansi_color.h │ └── DebugFilter.h ├── .idea ├── dictionaries │ └── Daniel.xml ├── codeStyles │ └── codeStyleConfig.xml ├── vcs.xml ├── .gitignore ├── modules.xml ├── runConfigurations │ ├── Run_exec_program__286_.xml │ └── Run_test_generator__286____dry_run_.xml └── arduino_8088.iml ├── scripts ├── build_8080.bat ├── build.bat ├── build2.bat ├── build_286.bat └── build_386.bat ├── asm ├── 386 │ └── program_386_dr7_undoc_bit.asm ├── 387 │ ├── fputest.asm │ ├── fpu_add.asm │ ├── program_fpu.asm │ ├── fpu_probe.asm │ └── fpu_add_1_plus_2.asm ├── program_setmo.asm ├── program.asm ├── program_8080.asm ├── program_jump286.asm ├── vcf2025 │ ├── dragonfade_256.asm │ └── tiny_bounce.asm ├── demos │ ├── plasmosis.asm │ ├── kefrensloop.asm │ ├── fasterTL.asm │ └── starpath.asm ├── program_disable_386ex_waits.asm ├── program_8080_regs.asm ├── program_setmo_regs.asm └── program_regs.asm ├── rustfmt.toml ├── LICENSE ├── Cargo.toml └── .gitignore /crates/arduinox86_cpu/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /crates/arduinox86_egui/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /crates/arduinox86_client/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /crates/arduinox86_client/src/commands.rs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cfg/arduinox86_gui.toml: -------------------------------------------------------------------------------- 1 | assembly_output_path = "build_output" -------------------------------------------------------------------------------- /shields/80186/kicad/.gitignore: -------------------------------------------------------------------------------- 1 | \~_autosave-*.kicad_pcb.lck 2 | -------------------------------------------------------------------------------- /shields/808x/kicad/.gitignore: -------------------------------------------------------------------------------- 1 | \~_autosave-*.kicad_pcb.lck 2 | -------------------------------------------------------------------------------- /shields/808X_V3/kicad/.gitignore: -------------------------------------------------------------------------------- 1 | \~_autosave-*.kicad_pcb.lck 2 | -------------------------------------------------------------------------------- /images/pcb_v1_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbalsom/arduinoX86/HEAD/images/pcb_v1_1.png -------------------------------------------------------------------------------- /images/render_v1_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbalsom/arduinoX86/HEAD/images/render_v1_1.png -------------------------------------------------------------------------------- /images/pcb_shield50.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbalsom/arduinoX86/HEAD/images/pcb_shield50.PNG -------------------------------------------------------------------------------- /images/arduino8088_pcb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbalsom/arduinoX86/HEAD/images/arduino8088_pcb.jpg -------------------------------------------------------------------------------- /platformio/ArduinoX86/src/src.ino: -------------------------------------------------------------------------------- 1 | // This is a dummy .ino file to allow project compilation with Arduino IDE. 2 | -------------------------------------------------------------------------------- /sketches/cpu_server/asm/pop_cs.asm: -------------------------------------------------------------------------------- 1 | cpu 8086 2 | org 0h 3 | 4 | mov ax, 0xd000 5 | push ax 6 | pop cs 7 | nop 8 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/asm/pop_cs.asm: -------------------------------------------------------------------------------- 1 | cpu 8086 2 | org 0h 3 | 4 | mov ax, 0xd000 5 | push ax 6 | pop cs 7 | nop 8 | -------------------------------------------------------------------------------- /.idea/dictionaries/Daniel.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /images/arduino8088_breadboard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbalsom/arduinoX86/HEAD/images/arduino8088_breadboard.jpg -------------------------------------------------------------------------------- /shields/386EX/images/386ex_hat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbalsom/arduinoX86/HEAD/shields/386EX/images/386ex_hat.jpg -------------------------------------------------------------------------------- /platformio/ArduinoX86/asm/loadall_386.asm: -------------------------------------------------------------------------------- 1 | ; loadall_386.asm 2 | 3 | cpu 386 4 | org 0h 5 | 6 | mov edi, 0800h 7 | loadall -------------------------------------------------------------------------------- /crates/arduinox86_egui/assets/icon-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbalsom/arduinoX86/HEAD/crates/arduinox86_egui/assets/icon-256.png -------------------------------------------------------------------------------- /images/arduinox86_logo_transparent_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbalsom/arduinoX86/HEAD/images/arduinox86_logo_transparent_01.png -------------------------------------------------------------------------------- /shields/80186/README.md: -------------------------------------------------------------------------------- 1 | ## ArduinoX86 8018X Shield 2 | 3 | This will eventually be a shield for the 80186. It is still being designed. -------------------------------------------------------------------------------- /shields/386EX_387SX/images/387_render_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbalsom/arduinoX86/HEAD/shields/386EX_387SX/images/387_render_01.png -------------------------------------------------------------------------------- /shields/386EX_387SX/images/387_schematic_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbalsom/arduinoX86/HEAD/shields/386EX_387SX/images/387_schematic_01.png -------------------------------------------------------------------------------- /shields/386EX_V4/images/386ex_v4_render_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbalsom/arduinoX86/HEAD/shields/386EX_V4/images/386ex_v4_render_01.png -------------------------------------------------------------------------------- /platformio/ArduinoX86/.gitignore: -------------------------------------------------------------------------------- 1 | .pio 2 | .vscode/.browse.c_cpp.db* 3 | .vscode/c_cpp_properties.json 4 | .vscode/launch.json 5 | .vscode/ipch 6 | 7 | -------------------------------------------------------------------------------- /shields/808X_V3/README.md: -------------------------------------------------------------------------------- 1 | ## ArduinoX86 808X Shield 2 | 3 | This Shield supports the 8088, 8086, V20 and V30 CPUs. 4 | 5 | It is still being designed. -------------------------------------------------------------------------------- /scripts/build_8080.bat: -------------------------------------------------------------------------------- 1 | nasm ./asm/program_8080_regs.asm -o ./bin/regs.bin 2 | nasm ./asm/program_8080.asm -o ./bin/program.bin -l ./asm/program_8080.lst 3 | -------------------------------------------------------------------------------- /scripts/build.bat: -------------------------------------------------------------------------------- 1 | nasm -I ./asm/includes/ ./asm/%1_regs.asm -o ./bin/regs.bin 2 | nasm -I ./asm/includes/ ./asm/%1.asm -o ./bin/program.bin -l ./asm/%1.lst 3 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/asm/cpu_id.asm: -------------------------------------------------------------------------------- 1 | 2 | 3 | cpu 8086 4 | org 0h 5 | 6 | db 0xD6 ; SALC 7 | fnstcw [0] 8 | fwait 9 | nop 10 | nop 11 | -------------------------------------------------------------------------------- /scripts/build2.bat: -------------------------------------------------------------------------------- 1 | nasm -I ./asm/includes/ ./asm/regs.asm -o ./bin/regs.bin 2 | nasm -I ./asm/includes/ ./asm/program.asm -o ./bin/program.bin -l ./asm/program.lst 3 | -------------------------------------------------------------------------------- /sketches/cpu_server/asm/cpu_id.asm: -------------------------------------------------------------------------------- 1 | 2 | 3 | cpu 8086 4 | org 0h 5 | 6 | db 0xD6 ; SALC 7 | fnstcw [0] 8 | fwait 9 | nop 10 | nop 11 | -------------------------------------------------------------------------------- /shields/386EX/kicad/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (version 7) 3 | (lib (name "mega")(type "KiCad")(uri "${KIPRJMOD}/arduino.kicad_sym")(options "")(descr "")) 4 | ) 5 | -------------------------------------------------------------------------------- /scripts/build_286.bat: -------------------------------------------------------------------------------- 1 | nasm -I ./asm/includes/ ./asm/%1_regs_286.asm -o ./bin/regs_286.bin -l ./asm/regs_286.lst 2 | nasm -I ./asm/includes/ ./asm/%1.asm -o ./bin/program.bin -l ./asm/%1.lst 3 | -------------------------------------------------------------------------------- /scripts/build_386.bat: -------------------------------------------------------------------------------- 1 | nasm -I ./asm/includes/ ./asm/%1_regs_386.asm -o ./bin/regs_386.bin -l ./asm/regs_386.lst 2 | nasm -I ./asm/includes/ ./asm/%1.asm -o ./bin/program.bin -l ./asm/%1.lst 3 | -------------------------------------------------------------------------------- /asm/program_setmo.asm: -------------------------------------------------------------------------------- 1 | ; program.asm 2 | ; Compile with nasm to build program.bin for cpu_client 3 | ; nasm program.asm -o program.bin 4 | cpu 8086 5 | org 0h 6 | 7 | db 0D0h 8 | db 034h 9 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | # Datasource local storage ignored files 7 | /dataSources/ 8 | /dataSources.local.xml 9 | -------------------------------------------------------------------------------- /shields/808x/kicad/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (lib (name "Arduino_Library")(type "KiCad")(uri "${KIPRJMOD}/arduino.kicad_sym")(options "")(descr "")) 3 | (lib (name "logo")(type "KiCad")(uri "${KIPRJMOD}/logo.kicad_sym")(options "")(descr "")) 4 | ) 5 | -------------------------------------------------------------------------------- /asm/program.asm: -------------------------------------------------------------------------------- 1 | ; program.asm 2 | ; Compile with nasm to build program.bin for cpu_client 3 | ; nasm program.asm -o program.bin 4 | 5 | cpu 386 6 | bits 16 7 | org 100h 8 | 9 | start: 10 | mov ax, 01234h 11 | hlt 12 | -------------------------------------------------------------------------------- /shields/808X_V3/kicad/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (lib (name "Arduino_Library")(type "KiCad")(uri "${KIPRJMOD}/arduino.kicad_sym")(options "")(descr "")) 3 | (lib (name "logo")(type "KiCad")(uri "${KIPRJMOD}/logo.kicad_sym")(options "")(descr "")) 4 | ) 5 | -------------------------------------------------------------------------------- /crates/arduinox86_egui/.gitignore: -------------------------------------------------------------------------------- 1 | # Mac stuff: 2 | .DS_Store 3 | 4 | # trunk output folder 5 | dist 6 | 7 | # Rust compile target directories: 8 | target 9 | target_ra 10 | target_wasm 11 | 12 | # https://github.com/lycheeverse/lychee 13 | .lycheecache 14 | -------------------------------------------------------------------------------- /shields/386EX_V4/kicad/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (version 7) 3 | (lib (name "mega")(type "KiCad")(uri "${KIPRJMOD}/arduino.kicad_sym")(options "")(descr "")) 4 | (lib (name "387sx")(type "KiCad")(uri "${KIPRJMOD}/387sx.kicad_sym")(options "")(descr "")) 5 | ) 6 | -------------------------------------------------------------------------------- /shields/387SX_V2/kicad/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (version 7) 3 | (lib (name "mega")(type "KiCad")(uri "${KIPRJMOD}/arduino.kicad_sym")(options "")(descr "")) 4 | (lib (name "387sx")(type "KiCad")(uri "${KIPRJMOD}/387sx.kicad_sym")(options "")(descr "")) 5 | ) 6 | -------------------------------------------------------------------------------- /shields/486/kicad/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (version 7) 3 | (lib (name "486")(type "KiCad")(uri "${KIPRJMOD}/80486.kicad_sym")(options "")(descr "")) 4 | (lib (name "giga")(type "KiCad")(uri "${KIPRJMOD}/arduino-library.kicad_sym")(options "")(descr "")) 5 | ) 6 | -------------------------------------------------------------------------------- /shields/386EX_387SX/kicad/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (version 7) 3 | (lib (name "mega")(type "KiCad")(uri "${KIPRJMOD}/arduino.kicad_sym")(options "")(descr "")) 4 | (lib (name "387sx")(type "KiCad")(uri "${KIPRJMOD}/387sx.kicad_sym")(options "")(descr "")) 5 | ) 6 | -------------------------------------------------------------------------------- /shields/387SX_V2/README.md: -------------------------------------------------------------------------------- 1 | ## ArduinoX86 387SX Shield 2 | 3 | This is a shield for the 387SX FPU. It is designed to be stacked on top of the 386EX V4 board. 4 | 5 | ## BOM 6 | 7 | - This board has not been ordered and tested. I do not recommend being the first to do so! 8 | - TBD -------------------------------------------------------------------------------- /asm/program_8080.asm: -------------------------------------------------------------------------------- 1 | ; program_8080.asm 2 | ; Compile with nasm to build program.bin for cpu_client 3 | ; nasm program_8080.asm -o program.bin 4 | %include 'asm/i8080.inc' 5 | 6 | cpu 8086 7 | org 100h 8 | code8080 9 | 10 | mvi a, 0x00 11 | mvi b, 0x00 12 | add b 13 | -------------------------------------------------------------------------------- /asm/program_jump286.asm: -------------------------------------------------------------------------------- 1 | ; program.asm 2 | ; Compile with nasm to build program.bin for cpu_client 3 | ; nasm program.asm -o program.bin 4 | cpu 286 5 | org 0h 6 | 7 | start: 8 | jmp myjump 9 | myjump: 10 | mov ax, 0x1 11 | mov bx, 0x2 12 | add ax, bx 13 | hlt 14 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /asm/387/fputest.asm: -------------------------------------------------------------------------------- 1 | cpu 386 2 | mov eax, cr0 3 | or eax, 1<<1 ; MP = 1 (monitor coprocessor) 4 | and eax, ~((1<<2)|(1<<3)) ; EM = 0 (no emulation), TS = 0 5 | mov cr0, eax 6 | fninit 7 | fnclex ; clear any pending exceptions, just in case 8 | fsave [0200h] 9 | hlt -------------------------------------------------------------------------------- /platformio/ArduinoX86/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "platformio.platformio-ide" 6 | ], 7 | "unwantedRecommendations": [ 8 | "ms-vscode.cpptools-extension-pack" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /shields/286_5V/kicad/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (version 7) 3 | (lib (name "80286")(type "KiCad")(uri "${KIPRJMOD}/80286.kicad_sym")(options "")(descr "")) 4 | (lib (name "mega")(type "KiCad")(uri "${KIPRJMOD}/arduino.kicad_sym")(options "")(descr "")) 5 | (lib (name "intel")(type "Legacy")(uri "${KIPRJMOD}/MCU_Intel.lib")(options "")(descr "")) 6 | ) 7 | -------------------------------------------------------------------------------- /shields/286_5V/README.md: -------------------------------------------------------------------------------- 1 | ## ArduinoX86 286 5V Shield 2 | 3 | This Shield is for a 5V CMOS 286 in a PLCC-68 package, such as the Harris 80C286. 4 | 5 | > [!WARNING] 6 | > This hat is to be used ONLY with the Arduino GIGA. Using this HAT with an Arduino Due will damage/destroy your 7 | > Arduino. 8 | 9 | > [!CAUTION] 10 | > This hat is in development. Do not order it. -------------------------------------------------------------------------------- /shields/80186/kicad/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (version 7) 3 | (lib (name "logo")(type "KiCad")(uri "${KIPRJMOD}/logo.kicad_sym")(options "")(descr "")) 4 | (lib (name "giga")(type "KiCad")(uri "${KIPRJMOD}/arduino-library.kicad_sym")(options "")(descr "")) 5 | (lib (name "arduino")(type "KiCad")(uri "${KIPRJMOD}/arduino.kicad_sym")(options "")(descr "")) 6 | ) 7 | -------------------------------------------------------------------------------- /shields/808x/gerbers/ard8088-NPTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ; DRILL file {KiCad (6.0.7)} date Thu May 9 09:53:30 2024 3 | ; FORMAT={-:-/ absolute / metric / decimal} 4 | ; #@! TF.CreationDate,2024-05-09T09:53:30-04:00 5 | ; #@! TF.GenerationSoftware,Kicad,Pcbnew,(6.0.7) 6 | ; #@! TF.FileFunction,NonPlated,1,2,NPTH 7 | FMAT,2 8 | METRIC 9 | % 10 | G90 11 | G05 12 | T0 13 | M30 14 | -------------------------------------------------------------------------------- /asm/vcf2025/dragonfade_256.asm: -------------------------------------------------------------------------------- 1 | ; Dragon Fade 2 | ; 256x256 version 3 | ; by HellMood 4 | ; 5 | ; set si to 100h 6 | 7 | push 0xa000 8 | pop ds 9 | S: 10 | shr al,1 11 | add dx,si 12 | sar dx,1 13 | jnc B 14 | or al,0x20 15 | add si,149 16 | B: 17 | sub si,dx 18 | xor bl,bl 19 | mov bh,dl 20 | xor [bx+si],al 21 | jmp short S 22 | 23 | hlt -------------------------------------------------------------------------------- /asm/386/program_386_dr7_undoc_bit.asm: -------------------------------------------------------------------------------- 1 | ; program.asm 2 | ; Compile with nasm to build program.bin for cpu_client 3 | ; nasm program.asm -o program.bin 4 | cpu 386 5 | org 0h 6 | 7 | start: 8 | mov eax, dr7 9 | or eax, 000004000h 10 | mov dr7, eax 11 | nop 12 | nop 13 | nop 14 | nop 15 | nop 16 | nop 17 | nop 18 | nop 19 | nop 20 | nop 21 | 22 | hlt 23 | 24 | 25 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/src/util.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // Bit reverse LUT from http://graphics.stanford.edu/~seander/bithacks.html#BitReverseTable 4 | static const uint8_t BIT_REVERSE_TABLE[256] = 5 | { 6 | # define R2(n) n, n + 2*64, n + 1*64, n + 3*64 7 | # define R4(n) R2(n), R2(n + 2*16), R2(n + 1*16), R2(n + 3*16) 8 | # define R6(n) R4(n), R4(n + 2*4 ), R4(n + 1*4 ), R4(n + 3*4 ) 9 | R6(0), R6(2), R6(1), R6(3) 10 | }; 11 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/asm/loadall_386.lst: -------------------------------------------------------------------------------- 1 | 1 ; loadall_386.asm 2 | 2 3 | 3 cpu 386 4 | 4 org 0h 5 | 5 6 | 6 00000000 66BF00080000 mov edi, 0800h 7 | 7 00000006 0F07 loadall 8 | 7 ****************** warning: instruction obsolete but valid on the target CPU [-w+obsolete-valid] 9 | -------------------------------------------------------------------------------- /asm/demos/plasmosis.asm: -------------------------------------------------------------------------------- 1 | ; Plasmosis 2 | ; by Plex / BionFX 3 | %define DOS 0 4 | 5 | org 100h 6 | 7 | %if DOS 8 | mov al, 13h 9 | int 10h 10 | %endif 11 | push 0xa000 12 | pop es 13 | mov bx, 320 ; line width 14 | 15 | nextPixel: 16 | ; avg current value and 16-bit pixel in an adjacent line 17 | add ax, word [es:di+bx] 18 | rcr ax, 1 19 | dec ax 20 | neg bx ; switch lines 21 | 22 | stosw ; paint two pixels (high byte = main color / low byte = gradients) 23 | jmp nextPixel -------------------------------------------------------------------------------- /asm/program_disable_386ex_waits.asm: -------------------------------------------------------------------------------- 1 | ; 386ex_setup.asm 2 | cpu 386 3 | org 0h 4 | 5 | start: 6 | jmp -100h 7 | 8 | mov ax, 08000H ; Enable expanded I/O space 9 | out 23H, al ; unlock the re-map bits 10 | xchg al, ah 11 | out 22H, al ; Knock on the port 12 | out 22H, ax ; Knock again with 16-bits to set 13 | mov dx, 0F438h 14 | mov ax, 0380h 15 | out dx, ax 16 | mov dx, 0F43Eh 17 | mov ax, 0 18 | out dx, ax 19 | mov ax, 1 20 | mov dx, 0F43Ch 21 | out dx, ax 22 | -------------------------------------------------------------------------------- /crates/arduinox86_cpu/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "arduinox86_cpu" 3 | description = "A library crate that leverages the ArduinoX86 serial protocol to control various Intel CPUs." 4 | version.workspace = true 5 | edition.workspace = true 6 | authors.workspace = true 7 | license.workspace = true 8 | repository.workspace = true 9 | 10 | [lib] 11 | name = "arduinox86_cpu" 12 | path = "src/lib.rs" 13 | crate-type = ["cdylib", "lib"] 14 | 15 | [dependencies] 16 | arduinox86_client = { path = "../arduinox86_client" } 17 | env_logger.workspace = true 18 | log.workspace = true -------------------------------------------------------------------------------- /crates/exec_program/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "exec_program" 3 | description = "A utility to execute arbitrary code on an Intel 8088, 8086, NEC V20, or V30 CPU via an Arduino DUE." 4 | version.workspace = true 5 | edition.workspace = true 6 | authors.workspace = true 7 | license.workspace = true 8 | repository.workspace = true 9 | 10 | [[bin]] 11 | name = "exec_program" 12 | path = "src/main.rs" 13 | 14 | [dependencies] 15 | clap = { workspace = true, features = ["derive"] } 16 | arduinox86_cpu = { path = "../arduinox86_cpu" } 17 | env_logger.workspace = true 18 | log.workspace = true -------------------------------------------------------------------------------- /platformio/ArduinoX86/test/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for PlatformIO Test Runner and project tests. 3 | 4 | Unit Testing is a software testing method by which individual units of 5 | source code, sets of one or more MCU program modules together with associated 6 | control data, usage procedures, and operating procedures, are tested to 7 | determine whether they are fit for use. Unit testing finds problems early 8 | in the development cycle. 9 | 10 | More information about PlatformIO Unit Testing: 11 | - https://docs.platformio.org/en/latest/advanced/unit-testing/index.html 12 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/asm/cpu_id.lst: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 cpu 8086 4 | 4 org 0h 5 | 5 6 | 6 00000000 D6 db 0xD6 ; SALC 7 | 7 00000001 D93E0000 fnstcw [0] 8 | 8 00000005 9B fwait 9 | 9 00000006 90 nop 10 | 10 00000007 90 nop 11 | 11 12 | -------------------------------------------------------------------------------- /sketches/cpu_server/asm/cpu_id.lst: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 cpu 8086 4 | 4 org 0h 5 | 5 6 | 6 00000000 D6 db 0xD6 ; SALC 7 | 7 00000001 D93E0000 fnstcw [0] 8 | 8 00000005 9B fwait 9 | 9 00000006 90 nop 10 | 10 00000007 90 nop 11 | 11 12 | -------------------------------------------------------------------------------- /asm/program_8080_regs.asm: -------------------------------------------------------------------------------- 1 | ; regs.asm 2 | ; Compile with nasm to build regs.bin for cpu_client 3 | ; nasm regs.asm -o regs.bin 4 | 5 | cpu 8086 6 | org 0h 7 | 8 | ; Specify the initial register state by modifying the values below. 9 | ; Assembling this file creates a BIN file representing the initial register state. 10 | ; Do not modify the order of the registers or add extra data. 11 | dw 0x1234 ; AX 12 | dw 0x0000 ; BX 13 | dw 0x0000 ; CX 14 | dw 0x0000 ; DX 15 | dw 0x0000 ; SS 16 | dw 0xFFFE ; SP 17 | dw 0xF002 ; FLAGS 18 | dw 0x0100 ; IP 19 | dw 0xF000 ; CS 20 | dw 0x0000 ; DS 21 | dw 0x0000 ; ES 22 | dw 0x0000 ; BP 23 | dw 0x0000 ; SI 24 | dw 0x0000 ; DI 25 | -------------------------------------------------------------------------------- /asm/program_setmo_regs.asm: -------------------------------------------------------------------------------- 1 | ; regs.asm 2 | ; Compile with nasm to build regs.bin for cpu_client 3 | ; nasm regs.asm -o regs.bin 4 | 5 | cpu 8086 6 | org 0h 7 | 8 | ; Specify the initial register state by modifying the values below. 9 | ; Assembling this file creates a BIN file representing the initial register state. 10 | ; Do not modify the order of the registers or add extra data. 11 | dw 0x0000 ; AX 12 | dw 0xd623 ; BX 13 | dw 0x0010 ; CX 14 | dw 0x0000 ; DX 15 | dw 0x0000 ; SS 16 | dw 0xFFFE ; SP 17 | dw 0xF002 ; FLAGS 18 | dw 0x0100 ; IP 19 | dw 0xF000 ; CS 20 | dw 0x762e ; DS 21 | dw 0x0000 ; ES 22 | dw 0x0000 ; BP 23 | dw 0x421b ; SI 24 | dw 0x0000 ; DI 25 | -------------------------------------------------------------------------------- /asm/387/fpu_add.asm: -------------------------------------------------------------------------------- 1 | ; fpu_add.asm 2 | ; Assemble with: nasm -f bin fpu_add.asm -o fpu_add.bin 3 | 4 | BITS 16 5 | org 0x100 ; .COM-style origin if running under DOS 6 | 7 | start: 8 | finit ; initialize FPU 9 | 10 | fld1 ; push constant 1.0 onto FPU stack 11 | fld1 ; push constant 1.0 again 12 | fadd st0, st0 ; st0 = 1.0 + 1.0 = 2.0 13 | fadd ; st1 = 1.0 + st0(2.0) -> st1=3.0, st0 popped 14 | 15 | fistp dword [result] ; store integer 3 into memory 16 | 17 | mov ecx, [result] ; load result into ECX 18 | 19 | hlt ; stop execution 20 | 21 | result: dd 0 -------------------------------------------------------------------------------- /shields/808x/gerbers/ard8088-Edge_Cuts.gm1: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,(6.0.7)*% 2 | %TF.CreationDate,2024-05-09T09:52:52-04:00*% 3 | %TF.ProjectId,ard8088,61726438-3038-4382-9e6b-696361645f70,1.1*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Profile,NP*% 6 | %FSLAX46Y46*% 7 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 8 | G04 Created by KiCad (PCBNEW (6.0.7)) date 2024-05-09 09:52:52* 9 | %MOMM*% 10 | %LPD*% 11 | G01* 12 | G04 APERTURE LIST* 13 | %TA.AperFunction,Profile*% 14 | %ADD10C,0.100000*% 15 | %TD*% 16 | G04 APERTURE END LIST* 17 | D10* 18 | X191770000Y-118110000D02* 19 | X95535456Y-118110000D01* 20 | X95535456Y-62230000D01* 21 | X191770000Y-62230000D01* 22 | X191770000Y-118110000D01* 23 | M02* 24 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; https://docs.platformio.org/page/projectconf.html 10 | 11 | [env:giga_r1_m7] 12 | platform = ststm32 13 | board = giga_r1_m7 14 | framework = arduino 15 | lib_deps = 16 | arduino-libraries/Arduino_GigaDisplay_GFX@^1.1.0 17 | 18 | [env:dueUSB] 19 | platform = atmelsam 20 | board = dueUSB 21 | framework = arduino 22 | lib_deps = 23 | arduino-libraries/Arduino_GigaDisplay_GFX@^1.1.0 24 | -------------------------------------------------------------------------------- /crates/test_generator/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test_generator" 3 | version.workspace = true 4 | edition.workspace = true 5 | authors.workspace = true 6 | license.workspace = true 7 | repository.workspace = true 8 | 9 | [dependencies] 10 | log.workspace = true 11 | env_logger.workspace = true 12 | clap = { workspace = true, features = ["derive"] } 13 | toml = { workspace = true } 14 | anyhow.workspace = true 15 | serde = { workspace = true, features = ["derive"] } 16 | rand.workspace = true 17 | rand_distr.workspace = true 18 | iced-x86.workspace = true 19 | indexmap.workspace = true 20 | arduinox86_client = { path = "../arduinox86_client", features = ["use_moo", "use_iced"] } 21 | moo-rs.workspace = true 22 | strum.workspace = true 23 | strum_macros.workspace = true -------------------------------------------------------------------------------- /crates/arduinox86_client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "arduinox86_client" 3 | description = "A library crate that implements a client for the ArduinoX86 serial protocol." 4 | version.workspace = true 5 | edition.workspace = true 6 | authors.workspace = true 7 | 8 | [lib] 9 | name = "arduinox86_client" 10 | path = "src/lib.rs" 11 | crate-type = ["cdylib", "lib"] 12 | 13 | [dependencies] 14 | log.workspace = true 15 | serialport.workspace = true 16 | binrw.workspace = true 17 | modular-bitfield.workspace = true 18 | rand.workspace = true 19 | rand_distr.workspace = true 20 | thiserror.workspace = true 21 | strum_macros.workspace = true 22 | 23 | moo-rs = { workspace = true, optional = true } 24 | iced-x86 = { workspace = true, optional = true } 25 | 26 | [features] 27 | use_moo = ["dep:moo-rs"] 28 | use_iced = ["iced-x86"] -------------------------------------------------------------------------------- /platformio/ArduinoX86/asm/cpu_setup_386ex.asm: -------------------------------------------------------------------------------- 1 | ; cpu_setup_386ex.asm 2 | cpu 386 3 | org 0h 4 | 5 | start: 6 | jmp -100h 7 | times 8 nop 8 | mov ax, 08000H ; Enable expanded I/O space 9 | out 23H, al ; unlock the re-map bits 10 | xchg al, ah 11 | out 22H, al ; Knock on the port 12 | out 22H, ax ; Knock again with 16-bits to set 13 | mov dx, 0F438h ; UCSADL - Chip-select Low Address 14 | mov ax, 0380h ; 0000_0011_1000_0000: Address 0, SMM bit clear, Bus Size 16, Memory, Ready Enabled, 0 wait states 15 | out dx, ax 16 | mov dx, 0F43Eh ; UCSMSKH - Chip-select High Mask 17 | mov ax, 0 18 | out dx, ax 19 | mov ax, 1 ; Enable the chip select channel 20 | mov dx, 0F43Ch ; UCSMSKL - Chip-select Low Mask 21 | out dx, ax 22 | -------------------------------------------------------------------------------- /asm/387/program_fpu.asm: -------------------------------------------------------------------------------- 1 | ; program.asm 2 | ; Compile with nasm to build program.bin for cpu_client 3 | ; nasm program.asm -o program.bin 4 | cpu 8086 5 | org 0h 6 | 7 | start: 8 | 9 | fldcw [fpu_cw] 10 | fwait 11 | 12 | ; Load num1 onto FPU stack 13 | fld qword [num1] ; ST(0) = num1 14 | fwait 15 | 16 | ; Load num2 onto FPU stack 17 | fld qword [num2] ; ST(0) = num2, ST(1) = num1 18 | fwait 19 | 20 | ; Add ST(0) and ST(1), result in ST(0), pop stack 21 | faddp st1, st0 ; ST(1) = ST(1) + ST(0), pop -> ST(0) now contains sum 22 | fwait 23 | 24 | ; Store result from ST(0) to memory 25 | fstp qword [result] ; store and pop 26 | fwait 27 | 28 | hlt 29 | 30 | ; --- data section below code --- 31 | align 2 32 | 33 | num1 dq 1.0 34 | num2 dq 2.0 35 | result dq 0.0 36 | fpu_cw dw 0x0000 -------------------------------------------------------------------------------- /asm/demos/kefrensloop.asm: -------------------------------------------------------------------------------- 1 | 2 | ; kefrensloop.asm 3 | ; kefrens effect main loop from 8088mph 4 | 5 | cpu 8086 6 | org 0h 7 | 8 | nop 9 | nop 10 | nop 11 | nop 12 | nop 13 | nop 14 | nop 15 | nop 16 | nop 17 | nop 18 | nop 19 | nop 20 | nop 21 | nop 22 | nop 23 | nop 24 | nop 25 | nop 26 | nop 27 | nop 28 | nop 29 | nop 30 | nop 31 | nop 32 | nop 33 | nop 34 | nop 35 | nop 36 | nop 37 | nop 38 | nop 39 | nop 40 | nop 41 | nop 42 | nop 43 | nop 44 | 45 | ; start of unrolled loop procedure 46 | mov al, [es:di] 47 | mov ds, bp 48 | lodsb 49 | out 0xE0, al ; what is this port(?) 50 | 51 | ; 2nd iteration for prefetch modelling 52 | mov ax,9999 53 | mov ds,ax 54 | mov sp,[bx] 55 | pop di 56 | mov al,[es:di] 57 | pop cx 58 | and ax,cx 59 | pop cx 60 | or ax,cx 61 | stosw 62 | pop ax 63 | and ah,[es:di+1] 64 | pop cx 65 | or ax,cx 66 | stosw 67 | pop ax 68 | out dx,al 69 | mov ds,bp 70 | lodsb 71 | out 0x60,al -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | 2 | # Daniel's opinionated rustfmt settings. 3 | # I was somewhat reluctant to use rustfmt at first as I am fairly opinionated about certain code formatting choices 4 | # and early tests on MartyPC mangled some very long match arms, especially in the instruction decoder. But I'm biting 5 | # the bullet and implementing it. 6 | 7 | max_width = 120 8 | 9 | # Keep 'if' and 'else' in the same column. 10 | # if lorem { 11 | # println!("ipsum!"); 12 | # } 13 | # else { 14 | # println!("dolor!"); 15 | # } 16 | control_brace_style = "ClosingNextLine" 17 | 18 | # I like to keep enum struct variants on one line if possible. The default of 35 is a bit too short and would 19 | # split this example into individual lines: 20 | # 21 | # pub enum ScalerOption { 22 | # Mode(ScalerMode), 23 | # Adjustment { h: f32, s: f32, b: f32, c: f32, g: f32 }, 24 | struct_variant_width = 65 25 | 26 | # Preferred input formats. 27 | imports_granularity = "Crate" 28 | imports_layout = "HorizontalVertical" 29 | 30 | # I like aligning things 31 | enum_discrim_align_threshold = 3 32 | struct_field_align_threshold = 3 -------------------------------------------------------------------------------- /asm/vcf2025/tiny_bounce.asm: -------------------------------------------------------------------------------- 1 | ; Tiny 64x64 Bounce for ArduinoX86 2 | ; by Plex 3 | 4 | %define DOS 0 5 | 6 | org 100h 7 | 8 | %if DOS 9 | mov al, 13h 10 | int 10h 11 | %endif 12 | push cs 13 | pop ds 14 | 15 | push 0xA000 16 | pop es 17 | 18 | mov si, 255 19 | mov bp, 139 20 | 21 | mov ax, 1 22 | mov cx, 0 23 | mov dx, 0 24 | mov bx, 64 * 255 25 | mov di, 64 * 139 26 | 27 | mov word [0], -255 28 | mov word [2], -139 29 | 30 | start: 31 | add cx, si 32 | test ch, 0xC0 33 | jz skip1 34 | sub cx, si 35 | neg si 36 | skip1: 37 | 38 | add dx, bp 39 | test dh, 0xC0 40 | jz skip2 41 | sub dx, bp 42 | neg bp 43 | skip2: 44 | 45 | pusha 46 | movzx di, ch 47 | shl di, 6 48 | shr dx, 8 49 | add di, dx 50 | 51 | add byte [es:di], al 52 | 53 | popa 54 | 55 | xchg cx, bx 56 | xchg dx, di 57 | xchg [0], si 58 | xchg [2], bp 59 | neg ax 60 | 61 | jmp start -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Arduino8088 Copyright 2022-2023 Daniel Balsom 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and associated documentation files (the “Software”), 5 | to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the 8 | Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /.idea/runConfigurations/Run_exec_program__286_.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 22 | -------------------------------------------------------------------------------- /crates/arduinox86_cpu/LICENSE: -------------------------------------------------------------------------------- 1 | Arduino8088 Copyright 2022-2023 Daniel Balsom 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and associated documentation files (the “Software”), 5 | to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the 8 | Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /crates/arduinox86_egui/LICENSE: -------------------------------------------------------------------------------- 1 | Arduino8088 Copyright 2022-2025 Daniel Balsom 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and associated documentation files (the “Software”), 5 | to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the 8 | Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /crates/exec_program/LICENSE: -------------------------------------------------------------------------------- 1 | Arduino8088 Copyright 2022-2023 Daniel Balsom 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and associated documentation files (the “Software”), 5 | to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the 8 | Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /.idea/runConfigurations/Run_test_generator__286____dry_run_.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 22 | -------------------------------------------------------------------------------- /crates/arduinox86_client/LICENSE: -------------------------------------------------------------------------------- 1 | Arduino8088 Copyright 2022-2023 Daniel Balsom 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and associated documentation files (the “Software”), 5 | to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the 8 | Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /platformio/ArduinoX86/lib/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link into the executable file. 4 | 5 | The source code of each library should be placed in a separate directory 6 | ("lib/your_library_name/[Code]"). 7 | 8 | For example, see the structure of the following example libraries `Foo` and `Bar`: 9 | 10 | |--lib 11 | | | 12 | | |--Bar 13 | | | |--docs 14 | | | |--examples 15 | | | |--src 16 | | | |- Bar.c 17 | | | |- Bar.h 18 | | | |- library.json (optional. for custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html 19 | | | 20 | | |--Foo 21 | | | |- Foo.c 22 | | | |- Foo.h 23 | | | 24 | | |- README --> THIS FILE 25 | | 26 | |- platformio.ini 27 | |--src 28 | |- main.c 29 | 30 | Example contents of `src/main.c` using Foo and Bar: 31 | ``` 32 | #include 33 | #include 34 | 35 | int main (void) 36 | { 37 | ... 38 | } 39 | 40 | ``` 41 | 42 | The PlatformIO Library Dependency Finder will find automatically dependent 43 | libraries by scanning project source files. 44 | 45 | More information about PlatformIO Library Dependency Finder 46 | - https://docs.platformio.org/page/librarymanager/ldf.html 47 | -------------------------------------------------------------------------------- /asm/demos/fasterTL.asm: -------------------------------------------------------------------------------- 1 | ;; 2 | ;; play with 70_000 cycles in dosbox 3 | ;; 4 | %define DOS 1 5 | org 100h 6 | 7 | les bp, [bx] ; sets BP = 0x20CD --> so I have a decent start value for a count down to zero 8 | 9 | %if DOS 10 | mov al, 0x13 11 | int 0x10 12 | %endif 13 | shr bp, 1 ; half the duration until reaching zero 14 | 15 | ; palette 16 | palette_loop: 17 | mov dx, 3C9h ; data register for color palette (0x3C9) 18 | mov al, cl 19 | out dx, al ; red 20 | shr al, 1 21 | out dx, al ; green 22 | shr al, 1 23 | out dx, al ; blue 24 | loop palette_loop 25 | 26 | frameloop: 27 | mov ax,0cccdh 28 | mul di ; dl = x , dh=y 29 | 30 | sub dx, 140 + 100 * 256 ; center tunnels on screen 31 | 32 | ; calculate z^2 = RADIUS^2 - (x^2 + y^2) 33 | mov al, dl 34 | imul al ; dx = x^2 35 | mov bx, ax 36 | mov al, dh 37 | imul al ; dx = y^2 38 | add bx, ax ; result in bx 39 | jz paint 40 | 41 | ; divide 42 | movsx ax, dl 43 | imul bp 44 | idiv bx 45 | 46 | add ax, bp 47 | xor al, 8 48 | paint: 49 | stosb 50 | 51 | cmpsw ; inc DI, 3 interlace effect 52 | loop frameloop 53 | 54 | dec bp ; decrement time 55 | jmp frameloop -------------------------------------------------------------------------------- /.idea/arduino_8088.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /crates/arduinox86_egui/src/widgets/mod.rs: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | pub mod cycle_display; 25 | pub mod mount_address_widget; 26 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/include/exceptions.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | 26 | #define EXCEPTION_ADDR_GPF 0x000034 27 | -------------------------------------------------------------------------------- /shields/808x/gerbers/ard8088-B_Paste.gbp: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,(6.0.7)*% 2 | %TF.CreationDate,2024-05-09T09:52:52-04:00*% 3 | %TF.ProjectId,ard8088,61726438-3038-4382-9e6b-696361645f70,1.1*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Paste,Bot*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW (6.0.7)) date 2024-05-09 09:52:52* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | G04 Aperture macros list* 15 | %AMRoundRect* 16 | 0 Rectangle with rounded corners* 17 | 0 $1 Rounding radius* 18 | 0 $2 $3 $4 $5 $6 $7 $8 $9 X,Y pos of 4 corners* 19 | 0 Add a 4 corners polygon primitive as box body* 20 | 4,1,4,$2,$3,$4,$5,$6,$7,$8,$9,$2,$3,0* 21 | 0 Add four circle primitives for the rounded corners* 22 | 1,1,$1+$1,$2,$3* 23 | 1,1,$1+$1,$4,$5* 24 | 1,1,$1+$1,$6,$7* 25 | 1,1,$1+$1,$8,$9* 26 | 0 Add four rect primitives between the rounded corners* 27 | 20,1,$1+$1,$2,$3,$4,$5,0* 28 | 20,1,$1+$1,$4,$5,$6,$7,0* 29 | 20,1,$1+$1,$6,$7,$8,$9,0* 30 | 20,1,$1+$1,$8,$9,$2,$3,0*% 31 | G04 Aperture macros list end* 32 | %ADD10RoundRect,0.250000X-0.475000X0.337500X-0.475000X-0.337500X0.475000X-0.337500X0.475000X0.337500X0*% 33 | G04 APERTURE END LIST* 34 | D10* 35 | %TO.C,C2*% 36 | X118626888Y-102925286D03* 37 | X118626888Y-105000286D03* 38 | %TD*% 39 | M02* 40 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/src/Vga.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | #include 24 | #include 25 | constexpr uint16_t Vga::default_palette_[256]; -------------------------------------------------------------------------------- /platformio/ArduinoX86/src/strings.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include 4 | 5 | extern const char RESPONSE_CHRS[] = { 6 | '!', '.' 7 | }; 8 | 9 | const char VERSION_DAT[] = { 10 | 'a', 'r', 'd', 'x', '8', '6', ' ' 11 | }; 12 | 13 | extern constexpr size_t VERSION_DAT_LEN = sizeof(VERSION_DAT); 14 | 15 | extern const char MACHINE_STATE_CHARS[] = { 16 | 'R', 'I', 'C', 'J', 'L', 'M', '8', 'P', 'E', 'F', 'X', '9', 'S', 'T', 'D' 17 | }; 18 | 19 | extern const char * const MACHINE_STATE_STRINGS[] = { 20 | "Reset", 21 | "CpuId", 22 | "CpuSetup", 23 | "JumpVector", 24 | "Load", 25 | "LoadDone", 26 | "EmuEnter", 27 | "Prefetch", 28 | "Execute", 29 | "ExecuteFinalize", 30 | "ExecuteDone", 31 | "EmuExit", 32 | "Store", 33 | "StoreDone", 34 | "Done" 35 | }; 36 | 37 | extern const char * const CMD_STRINGS[] = { 38 | "NONE", 39 | "VERSION", 40 | "RESET", 41 | "LOAD", 42 | "CYCLE", 43 | "READADDRLATCH", 44 | "READSTATUS", 45 | "READ8288CMD", 46 | "READ8288CTRL", 47 | "READDATABUS", 48 | "WRITEDATABUS", 49 | "FINALIZE", 50 | "BEGINSTORE", 51 | "STORE", 52 | "QUEUELEN", 53 | "QUEUEBYTES", 54 | "WRITEPIN", 55 | "READPIN", 56 | "GETPGMSTATE", 57 | "GETLASTERR", 58 | "GETCYCLESTATE", 59 | "CGETCYCLESTATE", 60 | "PREFETCHSTORE", 61 | "READADDRBUS", 62 | "CPUTYPE", 63 | "EMULATE8080", 64 | "PREFETCH", 65 | "INITSCREEN", 66 | "INVALID", 67 | }; -------------------------------------------------------------------------------- /platformio/ArduinoX86/asm/cpu_setup_386ex.lst: -------------------------------------------------------------------------------- 1 | 1 ; cpu_setup_386ex.asm 2 | 2 cpu 386 3 | 3 org 0h 4 | 4 5 | 5 start: 6 | 6 00000000 E9(00FF) jmp -100h 7 | 7 00000003 90 times 8 nop 8 | 8 0000000B B80080 mov ax, 08000H ; Enable expanded I/O space 9 | 9 0000000E E623 out 23H, al ; unlock the re-map bits 10 | 10 00000010 86C4 xchg al, ah 11 | 11 00000012 E622 out 22H, al ; Knock on the port 12 | 12 00000014 E722 out 22H, ax ; Knock again with 16-bits to set 13 | 13 00000016 BA38F4 mov dx, 0F438h 14 | 14 00000019 B88003 mov ax, 0380h 15 | 15 0000001C EF out dx, ax 16 | 16 0000001D BA3EF4 mov dx, 0F43Eh 17 | 17 00000020 B80000 mov ax, 0 18 | 18 00000023 EF out dx, ax 19 | 19 00000024 B80100 mov ax, 1 20 | 20 00000027 BA3CF4 mov dx, 0F43Ch 21 | 21 0000002A EF out dx, ax 22 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/include/interrupts.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | 26 | void ale_interrupt_handler(); 27 | void readyo_interrupt_handler(); 28 | void cycle_edge_interrupt_handler(); -------------------------------------------------------------------------------- /platformio/ArduinoX86/include/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project header files. 3 | 4 | A header file is a file containing C declarations and macro definitions 5 | to be shared between several project source files. You request the use of a 6 | header file in your project source file (C, C++, etc) located in `src` folder 7 | by including it, with the C preprocessing directive `#include'. 8 | 9 | ```src/main.c 10 | 11 | #include "header.h" 12 | 13 | int main (void) 14 | { 15 | ... 16 | } 17 | ``` 18 | 19 | Including a header file produces the same results as copying the header file 20 | into each source file that needs it. Such copying would be time-consuming 21 | and error-prone. With a header file, the related declarations appear 22 | in only one place. If they need to be changed, they can be changed in one 23 | place, and programs that include the header file will automatically use the 24 | new version when next recompiled. The header file eliminates the labor of 25 | finding and changing all the copies as well as the risk that a failure to 26 | find one copy will result in inconsistencies within a program. 27 | 28 | In C, the convention is to give header files names that end with `.h'. 29 | 30 | Read more about using header files in official GCC documentation: 31 | 32 | * Include Syntax 33 | * Include Operation 34 | * Once-Only Headers 35 | * Computed Includes 36 | 37 | https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html 38 | -------------------------------------------------------------------------------- /crates/arduinox86_egui/src/controls/mod.rs: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | pub mod canvas; 25 | pub mod cycle_table; 26 | pub mod data_table; 27 | pub mod data_visualizer; 28 | pub mod registers_v3; 29 | pub mod tab_group; 30 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = [ 3 | "crates/arduinox86_client", 4 | "crates/arduinox86_cpu", 5 | "crates/arduinox86_egui", 6 | "crates/exec_program", 7 | "crates/test_generator", 8 | ] 9 | resolver = "2" 10 | default-members = ["crates/exec_program"] 11 | 12 | [workspace.package] 13 | version = "0.3.0" 14 | edition = "2021" 15 | authors = ["Daniel Balsom"] 16 | license = "MIT" 17 | repository = "https://github.com/dbalsom/arduinoX86" 18 | 19 | [workspace.dependencies] 20 | clap = { version = "4.0", features = ["derive"] } 21 | env_logger = "0.11" 22 | log = "0.4" 23 | serialport = "~4.7.2" 24 | modular-bitfield = "0.11" 25 | binrw = "0.15" 26 | serde = { version = "1.0", features = ["derive"] } 27 | toml = { version = "0.8" } 28 | anyhow = "1.0" 29 | thiserror = "2.0" 30 | rand = "0.9" 31 | rand_distr = "0.5" 32 | indexmap = "2.2" 33 | strum = "0.27" 34 | strum_macros = "0.27" 35 | moo-rs = { git = "https://github.com/dbalsom/moo", default-features = false, features = ["serde"] } 36 | crossbeam-channel = "0.5" 37 | pollster = "0.2" 38 | tempfile = "3.20" 39 | uuid = "1.18.0" 40 | egui-phosphor = { version = "0.10", features = ["fill"] } 41 | 42 | [workspace.dependencies.iced-x86] 43 | version = "1.21" 44 | default-features = false 45 | # See below for all features 46 | features = ["std", "encoder", "decoder", "op_code_info", "nasm", "instr_info", "serde"] 47 | 48 | #serialport = { git = "https://github.com/dbalsom/serialport-rs", branch = "arduino-fix" } 49 | -------------------------------------------------------------------------------- /crates/arduinox86_egui/src/config.rs: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | use serde::Deserialize; 24 | use std::path::PathBuf; 25 | 26 | #[derive(Debug, Default, Clone, Deserialize)] 27 | pub struct ConfigFile { 28 | pub assembly_output_path: PathBuf, 29 | } 30 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/asm/load.asm: -------------------------------------------------------------------------------- 1 | ; load.asm 2 | ; Original routine by Andreas Jonsson 3 | ; https://github.com/andreas-jonsson/virtualxt/tree/develop/tools/validator/pi8088 4 | ; 5 | ; Assemble with nasm: 6 | ; nasm load.asm -o load.bin 7 | 8 | ; This routine sets up a known register state. It must be patched by the validator 9 | ; program with the desired values replacing the word operands set to 0 here. 10 | 11 | ; Patching offsets are as follows: 12 | 13 | ; FLAGS = 0x00; 14 | ; BX = 0x0B; 15 | ; CX = 0x0E; 16 | ; DX = 0x11; 17 | ; SS = 0x14; 18 | ; DS = 0x19; 19 | ; ES = 0x1E; 20 | ; SP = 0x23; 21 | ; BP = 0x28; 22 | ; SI = 0x2D; 23 | ; DI = 0x32; 24 | ; AX = 0x37; 25 | ; IP = 0x3A; 26 | ; CS = 0x3C; 27 | 28 | cpu 8086 29 | org 0h 30 | 31 | dw 0 32 | 33 | mov ax, 0 34 | mov ss, ax 35 | mov sp, ax 36 | popf ; Flags 37 | 38 | mov bx, word 0 ; BX 39 | mov cx, word 0 ; CX 40 | mov dx, word 0 ; DX 41 | 42 | mov ax, word 0 ; SS 43 | mov ss, ax 44 | mov ax, word 0 ; DS 45 | mov ds, ax 46 | mov ax, word 0 ; ES 47 | mov es, ax 48 | mov ax, word 0 ; SP 49 | mov sp, ax 50 | mov ax, word 0 ; BP 51 | mov bp, ax 52 | mov ax, word 0 ; SI 53 | mov si, ax 54 | mov ax, word 0 ; DI 55 | mov di, ax 56 | 57 | mov ax, word 0 ; AX 58 | jmp 0:0 ; CS:IP 59 | -------------------------------------------------------------------------------- /sketches/cpu_server/asm/load.asm: -------------------------------------------------------------------------------- 1 | ; load.asm 2 | ; Original routine by Andreas Jonsson 3 | ; https://github.com/andreas-jonsson/virtualxt/tree/develop/tools/validator/pi8088 4 | ; 5 | ; Assemble with nasm: 6 | ; nasm load.asm -o load.bin 7 | 8 | ; This routine sets up a known register state. It must be patched by the validator 9 | ; program with the desired values replacing the word operands set to 0 here. 10 | 11 | ; Patching offsets are as follows: 12 | 13 | ; FLAGS = 0x00; 14 | ; BX = 0x0B; 15 | ; CX = 0x0E; 16 | ; DX = 0x11; 17 | ; SS = 0x14; 18 | ; DS = 0x19; 19 | ; ES = 0x1E; 20 | ; SP = 0x23; 21 | ; BP = 0x28; 22 | ; SI = 0x2D; 23 | ; DI = 0x32; 24 | ; AX = 0x37; 25 | ; IP = 0x3A; 26 | ; CS = 0x3C; 27 | 28 | cpu 8086 29 | org 0h 30 | 31 | dw 0 32 | 33 | mov ax, 0 34 | mov ss, ax 35 | mov sp, ax 36 | popf ; Flags 37 | 38 | mov bx, word 0 ; BX 39 | mov cx, word 0 ; CX 40 | mov dx, word 0 ; DX 41 | 42 | mov ax, word 0 ; SS 43 | mov ss, ax 44 | mov ax, word 0 ; DS 45 | mov ds, ax 46 | mov ax, word 0 ; ES 47 | mov es, ax 48 | mov ax, word 0 ; SP 49 | mov sp, ax 50 | mov ax, word 0 ; BP 51 | mov bp, ax 52 | mov ax, word 0 ; SI 53 | mov si, ax 54 | mov ax, word 0 ; DI 55 | mov di, ax 56 | 57 | mov ax, word 0 ; AX 58 | jmp 0:0 ; CS:IP 59 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "array": "cpp", 4 | "*.bak": "cpp", 5 | "mstd_iterator": "cpp", 6 | "string": "cpp", 7 | "string_view": "cpp", 8 | "atomic": "cpp", 9 | "cctype": "cpp", 10 | "chrono": "cpp", 11 | "clocale": "cpp", 12 | "cmath": "cpp", 13 | "condition_variable": "cpp", 14 | "cstdarg": "cpp", 15 | "cstddef": "cpp", 16 | "cstdint": "cpp", 17 | "cstdio": "cpp", 18 | "cstdlib": "cpp", 19 | "cstring": "cpp", 20 | "ctime": "cpp", 21 | "cwchar": "cpp", 22 | "cwctype": "cpp", 23 | "deque": "cpp", 24 | "forward_list": "cpp", 25 | "list": "cpp", 26 | "unordered_map": "cpp", 27 | "unordered_set": "cpp", 28 | "vector": "cpp", 29 | "exception": "cpp", 30 | "algorithm": "cpp", 31 | "functional": "cpp", 32 | "iterator": "cpp", 33 | "map": "cpp", 34 | "memory": "cpp", 35 | "memory_resource": "cpp", 36 | "optional": "cpp", 37 | "ratio": "cpp", 38 | "set": "cpp", 39 | "system_error": "cpp", 40 | "tuple": "cpp", 41 | "type_traits": "cpp", 42 | "utility": "cpp", 43 | "fstream": "cpp", 44 | "initializer_list": "cpp", 45 | "iomanip": "cpp", 46 | "iosfwd": "cpp", 47 | "istream": "cpp", 48 | "limits": "cpp", 49 | "mutex": "cpp", 50 | "new": "cpp", 51 | "ostream": "cpp", 52 | "sstream": "cpp", 53 | "stdexcept": "cpp", 54 | "streambuf": "cpp", 55 | "thread": "cpp", 56 | "cinttypes": "cpp", 57 | "typeinfo": "cpp" 58 | } 59 | } -------------------------------------------------------------------------------- /asm/program_regs.asm: -------------------------------------------------------------------------------- 1 | ; ----------------------------------------------------------------------------- 2 | ; program_regs.asm 3 | ; 4 | ; Registers for 8088, 8086, V20, V30 and 80186 CPUs. 5 | ; For 80286 CPUs, use program_regs_286.asm. 6 | ; 7 | ; Assembling this file creates a BIN file representing the initial register state. 8 | ; Assemble with NASM: 9 | ; nasm program_regs.asm -o regs.bin 10 | ; ----------------------------------------------------------------------------- 11 | %define CPU_8086 12 | %include "ArduinoX86.inc" 13 | org 0h 14 | 15 | ; Specify the initial register state here by modifying these defines. 16 | ; ----------------------------------------------------------------------------- 17 | %define CS_REG 0xF000 18 | %define IP_REG 0x0100 19 | %define FLAGS_REG 0xF002 20 | 21 | %define AX_REG 0x0000 22 | %define BX_REG 0x0000 23 | %define CX_REG 0x0000 24 | %define DX_REG 0x0000 25 | 26 | %define DS_REG 0x0000 27 | %define SS_REG 0x0000 28 | %define ES_REG 0xC000 29 | 30 | %define SI_REG 0x0000 31 | %define DI_REG 0x0000 32 | 33 | %define BP_REG 0x0000 34 | %define SP_REG 0xFFFE 35 | 36 | ; Do not modify the order of the registers or add extra data. 37 | ; ----------------------------------------------------------------------------- 38 | SECTION .data 39 | dw AX_REG ; AX 40 | dw BX_REG ; BX 41 | dw CX_REG ; CX 42 | dw DX_REG ; DX 43 | dw IP_REG ; IP 44 | dw CS_REG ; CS 45 | dw FLAGS_REG ; FLAGS 46 | dw SS_REG ; SS 47 | dw SP_REG ; SP 48 | dw DS_REG ; DS 49 | dw ES_REG ; ES 50 | dw BP_REG ; BP 51 | dw SI_REG ; SI 52 | dw DI_REG ; DI 53 | -------------------------------------------------------------------------------- /crates/arduinox86_egui/src/async_exec.rs: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | use crossbeam_channel::Sender; 25 | use std::future::Future; 26 | 27 | pub fn exec_async + Send + 'static, S: Send + 'static>(sender: Sender, f: F) { 28 | std::thread::spawn(move || { 29 | let result = pollster::block_on(f); 30 | sender.send(result).unwrap(); 31 | }); 32 | } 33 | -------------------------------------------------------------------------------- /sketches/cpu_server/buzzer.ino: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | // Buzzer control routines 25 | 26 | void beep(uint32_t time) { 27 | pinMode(BUZZER_PIN, OUTPUT); 28 | digitalWrite(BUZZER_PIN, HIGH); 29 | delay(time); 30 | digitalWrite(BUZZER_PIN, LOW); 31 | } 32 | 33 | void error_beep() { 34 | beep(100); 35 | delay(100); 36 | beep(100); 37 | delay(100); 38 | beep(100); 39 | } 40 | -------------------------------------------------------------------------------- /crates/arduinox86_egui/src/windows/mod.rs: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | pub mod binary_view; 24 | pub mod client_window; 25 | pub mod code_editor; 26 | pub mod memory_viewer; 27 | pub mod register_window; 28 | 29 | pub use binary_view::BinaryView; 30 | pub use client_window::ClientWindow; 31 | pub use code_editor::CodeEditor; 32 | pub use memory_viewer::MemoryViewer; 33 | pub use register_window::RegisterWindow; 34 | -------------------------------------------------------------------------------- /asm/387/fpu_probe.asm: -------------------------------------------------------------------------------- 1 | ; fpu_sw_status_to_dx.asm 2 | ; Bare-metal x87 presence check and copy FPU status word into DX. 3 | ; Result: ECX = 1 if FPU present (and DX = status), else ECX = 0 (DX = 0xFFFF) 4 | 5 | BITS 16 6 | org 100h 7 | 8 | start: 9 | cli 10 | 11 | ; Make DS=ES=SS=CS so labels are addressable safely 12 | push cs 13 | pop ds 14 | push cs 15 | pop es 16 | push cs 17 | pop ss 18 | 19 | mov sp, stack_top 20 | 21 | ; Defaults 22 | xor eax, eax ; EAX = 0 (assume no FPU) 23 | mov dx, 0FFFFh ; DX = sentinel if no FPU 24 | 25 | ; ---- Presence test: memory form (doesn't touch AX) ---- 26 | mov word [fpu_sw], 0x5A5A 27 | fnstsw [fpu_sw] ; if no x87, 0x5A5A remains 28 | 29 | cmp word [fpu_sw], 0x5A5A 30 | je .no_fpu 31 | 32 | ; Optional confirm: init and verify a second store happens 33 | fninit 34 | mov word [fpu_sw], 0xFFFF 35 | fnstsw [fpu_sw] 36 | cmp word [fpu_sw], 0xFFFF 37 | je .no_fpu ; didn't overwrite -> treat as no FPU 38 | 39 | ; ---- Copy status into DX and report success ---- 40 | fnstcw [fpu_cw] ; store control word 41 | mov cx, [fpu_cw] ; load into CX 42 | mov dx, [fpu_sw] ; load status word into DX 43 | mov eax, 1 ; EAX = 1 (FPU present) 44 | 45 | .no_fpu: 46 | .hang: 47 | hlt 48 | jmp .hang 49 | 50 | ; ---- Data ---- 51 | align 2 52 | fpu_sw dw 0 53 | fpu_cw dw 0 54 | 55 | ; ---- Stack ---- 56 | stack_area: 57 | times 512 db 0 58 | stack_top: -------------------------------------------------------------------------------- /platformio/ArduinoX86/src/buzzer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #include 25 | 26 | // Buzzer control routines 27 | 28 | 29 | void beep(uint32_t time) { 30 | // pinMode(BUZZER_PIN, OUTPUT); 31 | // digitalWrite(BUZZER_PIN, HIGH); 32 | // delay(time); 33 | // digitalWrite(BUZZER_PIN, LOW); 34 | } 35 | 36 | void error_beep() { 37 | beep(100); 38 | delay(100); 39 | beep(100); 40 | delay(100); 41 | beep(100); 42 | } 43 | -------------------------------------------------------------------------------- /asm/387/fpu_add_1_plus_2.asm: -------------------------------------------------------------------------------- 1 | ; fpu_add_1_plus_2.asm 2 | ; 386 + 387 bare-metal: add 1.0 + 2.0 with x87 and put integer result in ECX. 3 | ; Assemble: nasm -f bin fpu_add_1_plus_2.asm -o fpu_add.bin 4 | 5 | BITS 16 6 | org 100h 7 | 8 | start: 9 | cli 10 | 11 | ; ---- Make DS=ES=SS=CS and set up a small stack ---- 12 | push cs 13 | pop ds 14 | push cs 15 | pop es 16 | push cs 17 | pop ss 18 | mov sp, stack_top 19 | 20 | ; ---- Initialize CR0 for x87 use on a 386 ---- 21 | ; CR0: MP=bit1, EM=bit2, TS=bit3 22 | mov eax, cr0 23 | and eax, ~(1 << 2) ; EM = 0 (allow x87 opcodes) 24 | or eax, (1 << 1) ; MP = 1 25 | mov cr0, eax 26 | clts ; TS = 0 (allow immediate x87 use) 27 | 28 | ; ---- Put FPU into a known state ---- 29 | finit 30 | fwait ; ensure FINIT completed 31 | 32 | ; ---- Compute 1.0 + 2.0 ---- 33 | fld dword [one_f] ; ST0 = 1.0 34 | fld dword [two_f] ; ST0 = 2.0, ST1 = 1.0 35 | faddp st1, st0 ; ST1 = 1.0 + 2.0 = 3.0, pop -> ST0 = 3.0 36 | 37 | ; ---- Convert to integer and store ---- 38 | fistp dword [result] ; store 3 -> [result], pop 39 | fwait ; make sure store/exception reporting completed 40 | 41 | ; ---- Load into ECX --- 42 | mov ecx, [result] 43 | 44 | .hang: 45 | hlt 46 | jmp .hang ; park forever 47 | 48 | ; ---- Data (aligned) ---- 49 | align 4 50 | one_f dd 0x3f800000 ; 1.0f 51 | two_f dd 0x40000000 ; 2.0f 52 | result dd 0 53 | 54 | ; ---- Tiny stack ---- 55 | stack_area: 56 | times 512 db 0 57 | stack_top: -------------------------------------------------------------------------------- /platformio/ArduinoX86/include/serial_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | 26 | #define PACKET_SIZE 64 // Size of the packet buffer 27 | 28 | #if defined(__SAM3X8E__) // If Arduino DUE 29 | #define INBAND_SERIAL SerialUSB 30 | #define DEBUG_SERIAL Serial1 31 | #define FLUSH SERIAL.flush() 32 | #elif defined(ARDUINO_GIGA) // If Arduino GIGA 33 | #define INBAND_SERIAL Serial 34 | #define DEBUG_SERIAL Serial2 35 | #define FLUSH 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /shields/808X_V3/kicad/ard8088.kicad_prl: -------------------------------------------------------------------------------- 1 | { 2 | "board": { 3 | "active_layer": 31, 4 | "active_layer_preset": "All Layers", 5 | "auto_track_width": true, 6 | "hidden_netclasses": [], 7 | "hidden_nets": [], 8 | "high_contrast_mode": 0, 9 | "net_color_mode": 1, 10 | "opacity": { 11 | "images": 0.6, 12 | "pads": 1.0, 13 | "tracks": 1.0, 14 | "vias": 1.0, 15 | "zones": 0.6 16 | }, 17 | "ratsnest_display_mode": 0, 18 | "selection_filter": { 19 | "dimensions": true, 20 | "footprints": true, 21 | "graphics": true, 22 | "keepouts": true, 23 | "lockedItems": true, 24 | "otherItems": false, 25 | "pads": true, 26 | "text": true, 27 | "tracks": true, 28 | "vias": true, 29 | "zones": true 30 | }, 31 | "visible_items": [ 32 | 0, 33 | 1, 34 | 2, 35 | 3, 36 | 4, 37 | 5, 38 | 8, 39 | 9, 40 | 10, 41 | 11, 42 | 12, 43 | 13, 44 | 14, 45 | 15, 46 | 16, 47 | 17, 48 | 18, 49 | 19, 50 | 20, 51 | 21, 52 | 22, 53 | 23, 54 | 24, 55 | 25, 56 | 26, 57 | 27, 58 | 28, 59 | 29, 60 | 30, 61 | 32, 62 | 33, 63 | 34, 64 | 35, 65 | 36 66 | ], 67 | "visible_layers": "fffffff_ffffffff", 68 | "zone_display_mode": 0 69 | }, 70 | "git": { 71 | "repo_password": "", 72 | "repo_type": "", 73 | "repo_username": "", 74 | "ssh_key": "" 75 | }, 76 | "meta": { 77 | "filename": "ard8088.kicad_prl", 78 | "version": 3 79 | }, 80 | "project": { 81 | "files": [] 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /shields/386EX/kicad/arduino_386.kicad_prl: -------------------------------------------------------------------------------- 1 | { 2 | "board": { 3 | "active_layer": 31, 4 | "active_layer_preset": "", 5 | "auto_track_width": true, 6 | "hidden_netclasses": [], 7 | "hidden_nets": [], 8 | "high_contrast_mode": 0, 9 | "net_color_mode": 1, 10 | "opacity": { 11 | "images": 0.6, 12 | "pads": 1.0, 13 | "tracks": 1.0, 14 | "vias": 1.0, 15 | "zones": 0.6 16 | }, 17 | "ratsnest_display_mode": 0, 18 | "selection_filter": { 19 | "dimensions": false, 20 | "footprints": true, 21 | "graphics": false, 22 | "keepouts": false, 23 | "lockedItems": false, 24 | "otherItems": false, 25 | "pads": false, 26 | "text": true, 27 | "tracks": true, 28 | "vias": true, 29 | "zones": false 30 | }, 31 | "visible_items": [ 32 | 0, 33 | 1, 34 | 2, 35 | 3, 36 | 4, 37 | 5, 38 | 8, 39 | 9, 40 | 10, 41 | 11, 42 | 12, 43 | 13, 44 | 14, 45 | 15, 46 | 16, 47 | 17, 48 | 18, 49 | 19, 50 | 20, 51 | 21, 52 | 22, 53 | 23, 54 | 24, 55 | 25, 56 | 26, 57 | 27, 58 | 28, 59 | 29, 60 | 30, 61 | 32, 62 | 33, 63 | 34, 64 | 35, 65 | 36 66 | ], 67 | "visible_layers": "fffffff_ffffffff", 68 | "zone_display_mode": 0 69 | }, 70 | "git": { 71 | "repo_password": "", 72 | "repo_type": "", 73 | "repo_username": "", 74 | "ssh_key": "" 75 | }, 76 | "meta": { 77 | "filename": "arduino_386.kicad_prl", 78 | "version": 3 79 | }, 80 | "project": { 81 | "files": [] 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /shields/486/kicad/arduinox86_486_shield.kicad_prl: -------------------------------------------------------------------------------- 1 | { 2 | "board": { 3 | "active_layer": 0, 4 | "active_layer_preset": "All Layers", 5 | "auto_track_width": true, 6 | "hidden_netclasses": [], 7 | "hidden_nets": [], 8 | "high_contrast_mode": 0, 9 | "net_color_mode": 1, 10 | "opacity": { 11 | "images": 0.6, 12 | "pads": 1.0, 13 | "tracks": 1.0, 14 | "vias": 1.0, 15 | "zones": 0.36000001430511475 16 | }, 17 | "selection_filter": { 18 | "dimensions": true, 19 | "footprints": true, 20 | "graphics": true, 21 | "keepouts": true, 22 | "lockedItems": false, 23 | "otherItems": true, 24 | "pads": true, 25 | "text": true, 26 | "tracks": true, 27 | "vias": true, 28 | "zones": true 29 | }, 30 | "visible_items": [ 31 | 0, 32 | 1, 33 | 2, 34 | 3, 35 | 4, 36 | 5, 37 | 8, 38 | 9, 39 | 10, 40 | 11, 41 | 12, 42 | 13, 43 | 15, 44 | 16, 45 | 17, 46 | 18, 47 | 19, 48 | 20, 49 | 21, 50 | 22, 51 | 23, 52 | 24, 53 | 25, 54 | 26, 55 | 27, 56 | 28, 57 | 29, 58 | 30, 59 | 32, 60 | 33, 61 | 34, 62 | 35, 63 | 36, 64 | 39, 65 | 40 66 | ], 67 | "visible_layers": "fffffff_ffffffff", 68 | "zone_display_mode": 0 69 | }, 70 | "git": { 71 | "repo_password": "", 72 | "repo_type": "", 73 | "repo_username": "", 74 | "ssh_key": "" 75 | }, 76 | "meta": { 77 | "filename": "arduinox86_486_shield.kicad_prl", 78 | "version": 3 79 | }, 80 | "project": { 81 | "files": [] 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/asm/store_nmi.asm: -------------------------------------------------------------------------------- 1 | ; store.asm 2 | ; Original routine by Andreas Jonsson 3 | ; https://github.com/andreas-jonsson/virtualxt/tree/develop/tools/validator/pi8088 4 | ; 5 | ; Assemble with nasm: 6 | ; nasm store.asm -o store.bin 7 | 8 | ; Registers are output in turn to dummy IO addresses, intercepted by the validator 9 | ; program. End of the routine is indicated by a write to IO address 0xFD. 10 | 11 | ; This routine is intended to run out of an NMI handler that terminates program 12 | ; execution. Therefore IP, CS and FLAGS can be popped from the stack. 13 | 14 | cpu 8086 15 | org 0h 16 | 17 | times 6 nop 18 | 19 | out 0xFE, ax ; AX 20 | mov ax, bx 21 | out 0xFE, ax ; BX 22 | mov ax, cx 23 | out 0xFE, ax ; CX 24 | mov ax, dx 25 | out 0xFE, ax ; DX 26 | 27 | pop ax ; Pop IP from the stack. 28 | out 0xFE, ax ; IP 29 | 30 | pop ax ; Pop CS from the stack. 31 | out 0xFE, ax ; CS 32 | 33 | pop ax ; Pop Flags from the stack. 34 | out 0xFE, ax ; Flags 35 | 36 | mov ax, ss 37 | out 0xFE, ax ; SS 38 | mov ax, sp 39 | out 0xFE, ax ; SP 40 | 41 | mov ax, ds 42 | out 0xFE, ax ; DS 43 | mov ax, es 44 | out 0xFE, ax ; ES 45 | mov ax, bp 46 | out 0xFE, ax ; BP 47 | mov ax, si 48 | out 0xFE, ax ; SI 49 | mov ax, di 50 | out 0xFE, ax ; DI 51 | 52 | mov al, 0xFF ; Sent as a signal to the validator program that we are done. 53 | out 0xFD, al ; Done! 54 | -------------------------------------------------------------------------------- /sketches/cpu_server/BoardController.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | 26 | template 27 | class BoardController { 28 | Board& board; 29 | public: 30 | BoardController(Board& b) 31 | : board(b) {} 32 | 33 | void tick() { 34 | board.writePin(22, true); 35 | board.debugPrint(ansi::bright_green, "Pin 22 set HIGH\n"); 36 | board.writePin(22, false); 37 | board.debugPrintln(ansi::bright_red, "Pin 22 set LOW"); 38 | } 39 | }; -------------------------------------------------------------------------------- /sketches/cpu_server/asm/store_nmi.asm: -------------------------------------------------------------------------------- 1 | ; store.asm 2 | ; Original routine by Andreas Jonsson 3 | ; https://github.com/andreas-jonsson/virtualxt/tree/develop/tools/validator/pi8088 4 | ; 5 | ; Assemble with nasm: 6 | ; nasm store.asm -o store.bin 7 | 8 | ; Registers are output in turn to dummy IO addresses, intercepted by the validator 9 | ; program. End of the routine is indicated by a write to IO address 0xFD. 10 | 11 | ; This routine is intended to run out of an NMI handler that terminates program 12 | ; execution. Therefore IP, CS and FLAGS can be popped from the stack. 13 | 14 | cpu 8086 15 | org 0h 16 | 17 | times 6 nop 18 | 19 | out 0xFE, ax ; AX 20 | mov ax, bx 21 | out 0xFE, ax ; BX 22 | mov ax, cx 23 | out 0xFE, ax ; CX 24 | mov ax, dx 25 | out 0xFE, ax ; DX 26 | 27 | pop ax ; Pop IP from the stack. 28 | out 0xFE, ax ; IP 29 | 30 | pop ax ; Pop CS from the stack. 31 | out 0xFE, ax ; CS 32 | 33 | pop ax ; Pop Flags from the stack. 34 | out 0xFE, ax ; Flags 35 | 36 | mov ax, ss 37 | out 0xFE, ax ; SS 38 | mov ax, sp 39 | out 0xFE, ax ; SP 40 | 41 | mov ax, ds 42 | out 0xFE, ax ; DS 43 | mov ax, es 44 | out 0xFE, ax ; ES 45 | mov ax, bp 46 | out 0xFE, ax ; BP 47 | mov ax, si 48 | out 0xFE, ax ; SI 49 | mov ax, di 50 | out 0xFE, ax ; DI 51 | 52 | mov al, 0xFF ; Sent as a signal to the validator program that we are done. 53 | out 0xFD, al ; Done! 54 | -------------------------------------------------------------------------------- /crates/arduinox86_egui/src/thread_event.rs: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | use crate::{events::FrontendThreadEvent, App}; 24 | 25 | impl App { 26 | pub fn handle_thread_event(&mut self, _ctx: &egui::Context) { 27 | while let Ok(event) = self.thread_receiver.try_recv() { 28 | match event { 29 | FrontendThreadEvent::FileOpenDialogComplete { 30 | context, 31 | path, 32 | contents, 33 | } => {} 34 | _ => {} 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # General 2 | /notes/ 3 | /traces/ 4 | /asm/*.bin 5 | /sketches/convert_me/ 6 | /sketches/cpu_server_old/ 7 | /sketches/cpu_server_last/ 8 | /sketches/due_test/ 9 | /json/ 10 | 11 | # Arduino stuff 12 | 13 | # Ignore IDE folder 14 | .theia 15 | # Ignore compiled programs 16 | *.bin 17 | 18 | # Kicad stuff 19 | fp-info-cache 20 | fp-lib-table 21 | Arduino_101_Shield.kicad_mod 22 | Arduino_Due_Shield.kicad_mod 23 | Arduino_Leonardo_Shield.kicad_mod 24 | Arduino_Micro_Socket.kicad_mod 25 | Arduino_Mini_Socket.kicad_mod 26 | Arduino_Nano_Socket.kicad_mod 27 | Arduino_Pro_Mini_Socket.kicad_mod 28 | Arduino_Uno_Shield.kicad_mod 29 | Arduino_Zero_Shield.kicad_mod 30 | Pro_Mini_Clone_Socket.kicad_mod 31 | # 808X HAT 32 | shields/**/*.lck 33 | shields/**/*.bak 34 | shields/**/*.kicad_pcb.zip 35 | shields/**/*-backups/ 36 | shields/808x/kicad/gerbers* 37 | shields/808x/gerbers/*.zip 38 | shields/808x/kicad/ard8088.wrl 39 | # 286 HAT 40 | shields/286_5V/kicad/gerbers 41 | shields/286_5V/kicad/arduino_286_5v-backups 42 | shields/286_5V/kicad/arduino*bak 43 | shields/286_5V/kicad/Package_LCC.pretty/* 44 | !shields/286_5V/kicad/Package_LCC.pretty/286-plcc.pretty 45 | # 386EX HAT 46 | shields/386EX/kicad/gerbers 47 | shields/386EX/kicad/arduino_386-backups 48 | shields/386EX_V3 49 | shields/387SX 50 | 51 | \#auto_saved_files# 52 | _autosave* 53 | rescue-backup 54 | 55 | # ASM 56 | /asm/test 57 | 58 | # Rust stuff 59 | 60 | # Rust example client 61 | client/rust/target/ 62 | client/rust/scripts/build2.bat 63 | client/rust/asm/*.asm 64 | !client/rust/asm/program.asm 65 | !client/rust/asm/program_regs.asm 66 | 67 | 68 | # list files 69 | asm/*.lst 70 | 71 | 72 | # Generated by Cargo 73 | # will have compiled files and executables 74 | /target/ 75 | 76 | # These are backup files generated by rustfmt 77 | **/*.rs.bk 78 | 79 | -------------------------------------------------------------------------------- /crates/arduinox86_client/src/registers/mod.rs: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | pub mod register_printer; 25 | pub mod register_traits; 26 | pub mod registers_common; 27 | pub mod registers_v1; 28 | pub mod registers_v2; 29 | pub mod registers_v3; 30 | 31 | pub use register_traits::{Registers16, Registers32}; 32 | pub use registers_common::RemoteCpuRegisters; 33 | pub use registers_v1::RemoteCpuRegistersV1; 34 | pub use registers_v2::{RemoteCpuRegistersV2, SegmentDescriptorV1}; 35 | pub use registers_v3::{RemoteCpuRegistersV3, RemoteCpuRegistersV3A, RemoteCpuRegistersV3B, SegmentDescriptorV2}; 36 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/include/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | #include "boards/ArduinoDueBoard.h" 29 | #include "boards/ArduinoGigaBoard.h" 30 | 31 | // Select Board base (templated on Shield) 32 | #if defined(__SAM3X8E__) // If Arduino DUE 33 | template 34 | using BoardTypeBase = ArduinoDueBoard; 35 | #elif defined(ARDUINO_GIGA) 36 | template 37 | using BoardTypeBase = ArduinoGigaBoard; 38 | #else 39 | #error "Unsupported board type!" 40 | #endif 41 | 42 | using BoardType = BoardTypeBase; -------------------------------------------------------------------------------- /sketches/cpu_server/hats/Hat8088.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | 26 | #include "../hat_config.h" 27 | #include "../gpio_pins.h" 28 | 29 | struct Hat8088 { 30 | static constexpr unsigned ClockDivisor = 1; 31 | static constexpr unsigned ClockHighDelay = 0; 32 | static constexpr unsigned ClockLowDelay = 0; 33 | 34 | template 35 | inline static void cpuTick(Board& board) { 36 | WRITE_PIN_D04(1); 37 | if (ClockHighDelay > 0) { 38 | board.clockHighDelay(); 39 | } 40 | WRITE_PIN_D04(0); 41 | if (ClockLowDelay > 0) { 42 | board.clockLowDelay(); 43 | } 44 | } 45 | }; -------------------------------------------------------------------------------- /platformio/ArduinoX86/src/interrupts.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | /// @brief Handle assertion of ALE/ADS by deasserting READY pin. 31 | void ale_interrupt_handler() { 32 | DEBUG_SERIAL.println(">ADS"); 33 | 34 | if (READ_ABUS_23 &&!READ_M_IO_PIN) { 35 | DEBUG_SERIAL.println(">NPX"); 36 | WRITE_READY_PIN(READY_DEASSERT); 37 | } 38 | } 39 | 40 | void readyo_interrupt_handler() { 41 | WRITE_READY_PIN(READY_ASSERT); 42 | } 43 | 44 | void cycle_edge_interrupt_handler() { 45 | DEBUG_SERIAL.println("@"); 46 | } -------------------------------------------------------------------------------- /platformio/ArduinoX86/include/Display.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | #include 26 | #include 27 | 28 | class Display { 29 | public: 30 | virtual void init() {} 31 | virtual int rows() const { return 0; } 32 | virtual void updateCell(int line, int col, uint16_t color, const char* text) {} 33 | virtual uint16_t makeColor(uint8_t r, uint8_t g, uint8_t b) { 34 | return ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3); 35 | } 36 | virtual void trackFrame() {} 37 | virtual void trackUpdate() {} 38 | virtual void flush() {} 39 | virtual Vga *vga() { return nullptr; } 40 | virtual ~Display() = default; 41 | }; -------------------------------------------------------------------------------- /platformio/ArduinoX86/include/shields/Pins.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | /// @brief Enumeration of input pins used by the CPU. 29 | /// These pins can be referenced as parameters to a Shield's writePin() or readPin() methods, 30 | /// but there is no guarantee that all pins are implemented on all Hats. 31 | enum class OutputPin : uint8_t { 32 | Ready, 33 | Test, 34 | Intr, 35 | Nmi, 36 | Invalid, // Invalid pin variant is used as only previous pins in the list can be sent as 37 | // parameters to cmd_write_pin(). 38 | Reset, 39 | Clock, 40 | Hold, 41 | Busy, 42 | Smi, 43 | }; 44 | 45 | -------------------------------------------------------------------------------- /sketches/cpu_server/asm/store.asm: -------------------------------------------------------------------------------- 1 | ; store.asm 2 | ; Original routine by Andreas Jonsson 3 | ; https://github.com/andreas-jonsson/virtualxt/tree/develop/tools/validator/pi8088 4 | ; 5 | ; Assemble with nasm: 6 | ; nasm store.asm -o store.bin 7 | 8 | ; Registers are output in turn to dummy IO addresses, intercepted by the validator 9 | ; program. End of the routine is indicated by a write to IO address 0xFD. 10 | 11 | ; Since there is no direct 'MOV rm, flags' or 'MOV rm, ip' instruction, we push 12 | ; these two registers to the stack and intercept memory writes to the dummy stack 13 | ; space defined at 00000-00003. 14 | 15 | cpu 8086 16 | org 0h 17 | 18 | out 0xFE, ax ; AX 19 | mov ax, bx 20 | out 0xFE, ax ; BX 21 | mov ax, cx 22 | out 0xFE, ax ; CX 23 | mov ax, dx 24 | out 0xFE, ax ; DX 25 | 26 | mov ax, ss 27 | out 0xFE, ax ; SS 28 | mov ax, sp 29 | out 0xFE, ax ; SP 30 | 31 | mov ax, 0 32 | mov ss, ax 33 | mov ax, 4 34 | mov sp, ax ; Set up 4 bytes of stack for flags and IP. 35 | pushf ; Capture flags 36 | call _ip ; We capture IP when it is pushed to the stack on CALL. 37 | ; We then adjust it by 24 bytes to the start of the store procedure. 38 | _ip: 39 | mov ax, cs 40 | out 0xFE, ax ; CS 41 | mov ax, ds 42 | out 0xFE, ax ; DS 43 | mov ax, es 44 | out 0xFE, ax ; ES 45 | mov ax, bp 46 | out 0xFE, ax ; BP 47 | mov ax, si 48 | out 0xFE, ax ; SI 49 | mov ax, di 50 | out 0xFE, ax ; DI 51 | 52 | mov al, 0xFF ; Sent as a signal to the validator program that we are done. 53 | out 0xFD, al ; Done! 54 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/asm/store.asm: -------------------------------------------------------------------------------- 1 | ; store.asm 2 | ; Original routine by Andreas Jonsson 3 | ; https://github.com/andreas-jonsson/virtualxt/tree/develop/tools/validator/pi8088 4 | ; 5 | ; Assemble with nasm: 6 | ; nasm store.asm -o store.bin 7 | 8 | ; Registers are output in turn to dummy IO addresses, intercepted by the validator 9 | ; program. End of the routine is indicated by a write to IO address 0xFD. 10 | 11 | ; Since there is no direct 'MOV rm, flags' or 'MOV rm, ip' instruction, we push 12 | ; these two registers to the stack and intercept memory writes to the dummy stack 13 | ; space defined at 00000-00003. 14 | 15 | cpu 8086 16 | org 0h 17 | 18 | out 0xFE, ax ; AX 19 | mov ax, bx 20 | out 0xFE, ax ; BX 21 | mov ax, cx 22 | out 0xFE, ax ; CX 23 | mov ax, dx 24 | out 0xFE, ax ; DX 25 | 26 | mov ax, ss 27 | out 0xFE, ax ; SS 28 | mov ax, sp 29 | out 0xFE, ax ; SP 30 | 31 | mov ax, 0 32 | mov ss, ax 33 | mov ax, 4 34 | mov sp, ax ; Set up 4 bytes of stack for flags and IP. 35 | pushf ; Capture flags 36 | call _ip ; We capture IP when it is pushed to the stack on CALL. 37 | ; We then adjust it by 24 bytes to the start of the store procedure. 38 | _ip: 39 | mov ax, cs 40 | out 0xFE, ax ; CS 41 | mov ax, ds 42 | out 0xFE, ax ; DS 43 | mov ax, es 44 | out 0xFE, ax ; ES 45 | mov ax, bp 46 | out 0xFE, ax ; BP 47 | mov ax, si 48 | out 0xFE, ax ; SI 49 | mov ax, di 50 | out 0xFE, ax ; DI 51 | 52 | mov al, 0xFF ; Sent as a signal to the validator program that we are done. 53 | out 0xFD, al ; Done! 54 | -------------------------------------------------------------------------------- /crates/arduinox86_egui/src/lib.rs: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | #![warn(clippy::all, rust_2018_idioms)] 24 | 25 | mod app; 26 | mod assembler; 27 | mod async_exec; 28 | mod character_encoding; 29 | mod client; 30 | mod config; 31 | mod controls; 32 | mod enums; 33 | mod events; 34 | mod file_dialogs; 35 | mod range_check; 36 | mod register_state; 37 | mod resource_manager; 38 | mod scheduler; 39 | mod serial_manager; 40 | mod structs; 41 | mod style; 42 | mod thread_event; 43 | mod widgets; 44 | mod window_manager; 45 | mod windows; 46 | 47 | pub use app::App; 48 | use eframe::epaint::Color32; 49 | 50 | pub const DEFAULT_FONT_SIZE: f32 = 14.0; 51 | pub const TEXT_COLOR: Color32 = Color32::from_rgba_premultiplied(0xda, 0xda, 0xda, 0xff); 52 | -------------------------------------------------------------------------------- /shields/386EX_387SX/README.md: -------------------------------------------------------------------------------- 1 | ## ArduinoX86 386EX + 387SX Shield 2 | 3 | ![386ex_hat](./images/387_render_01.png) 4 | 5 | > [!WARNING] 6 | > This shield is deprecated and is included only for reference. 7 | > I recommend using the V4 386EX shield with the stacking 387SX shield. 8 | 9 | This is a shield for the 386EX CPU that includes a socket for the 387SX. 10 | The 386EX is a low-voltage variant of the 386 with a 16-bit data bus, intended for embedded applications. 11 | 12 | This shield has external power pins. You should connect either a 5V or 3.3V power source to the pins. I recommend using 13 | Dupont connectors. If you have a 387SX in the PLCC68 socket the board is unlikely to run properly without external 14 | power. 15 | 16 | This shield should be compatible with the Arduino Due and GIGA. If using a Due, do not supply more than 3.3V to the 17 | external power pins or you will damage your Arduino. 18 | 19 | Unsoldered new-old-stock 386EX chips are often available on eBay. If using a donor board, a hot plate or hot-air 20 | station will be necessary to successfully remove the CPU without damage. 21 | 22 | This shield adds new features over the original: 23 | 24 | - A PLCC68 socket has been added for the 387SX FPU and appropriate lines connected including PEREQ and ERROR 25 | - The SMI and SMIACT pins have been connected 26 | - The JTAG ports have been run out to a 2x4 header 27 | - The first Asynchronous serial port has been run out to a 2x5 header (Serial0) 28 | - The first 8 external INTR lines (INTR0-INTR7) have been run out to separate 1x4 headers 29 | - 7 status LEDs have been added that will report the status of SMIACT, ADS, RD, WR, W/R, C/M and M/IO. 30 | 31 | > [!WARNING] 32 | > Successfully assembling this board requires advanced soldering skills. A solder mask, paste and hot plate are 33 | > recommended, or solid experience in drag-soldering techniques. 34 | 35 | ## BOM 36 | 37 | - I don't recommend building this board. See the V4 board instead. -------------------------------------------------------------------------------- /crates/arduinox86_cpu/tests/flags.rs: -------------------------------------------------------------------------------- 1 | use arduinox86_client::*; 2 | use arduinox86_cpu::*; 3 | 4 | #[test] 5 | fn test_flag_init() { 6 | // Create a cpu_client connection to cpu_server. 7 | let cpu_client = match CpuClient::init(None, None) { 8 | Ok(ard_client) => { 9 | println!("Opened connection to Arduino_8088 server!"); 10 | ard_client 11 | } 12 | Err(e) => { 13 | eprintln!("Error connecting to Arduino_8088 server: {e}"); 14 | std::process::exit(1); 15 | } 16 | }; 17 | 18 | // Create a remote cpu instance using the cpu_client which should now be connected. 19 | let mut cpu = RemoteCpu::new(cpu_client, false, false, 0, 0, 0, 0); 20 | 21 | let regs = RemoteCpuRegistersV1 { 22 | ax: 0, 23 | bx: 0, 24 | cx: 0, 25 | dx: 0, 26 | ss: 0, 27 | ds: 0, 28 | es: 0, 29 | sp: 0xFFFF, 30 | bp: 0, 31 | si: 0, 32 | di: 0, 33 | cs: 0xF000, 34 | ip: 0x0000, 35 | flags: 0xF002, 36 | }; 37 | 38 | // Load the registers from struct 39 | let result = cpu.load_registers_from_struct(®s); 40 | if result { 41 | log::trace!("Successfully set up registers!"); 42 | 43 | // Load opcode into memory at cs:ip 44 | let pc = (regs.cs as usize) << 4 + regs.ip as usize; 45 | cpu.write_u8(pc, 0x90); // NOP 46 | cpu.set_program_bounds(pc, pc + 1); 47 | 48 | cpu.test(); 49 | match cpu.run(Some(100), &PrintOptions::default()) { 50 | Ok(regs) => { 51 | println!("Flags: {:04X}", regs.flags()); 52 | } 53 | Err(_) => { 54 | log::error!("Program execution failed!"); 55 | } 56 | } 57 | } 58 | else { 59 | log::error!("Register setup failed: {}", cpu.get_last_error()); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/include/Shield.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | #include 26 | 27 | #if defined(SHIELD_8088_V1) 28 | #include 29 | class Shield8088; 30 | using ShieldType = Shield8088; 31 | #elif defined(SHIELD_80186_3V_V1) 32 | #include 33 | class Shield80186; 34 | using ShieldType = Shield80186; 35 | #elif defined(SHIELD_286_5V_V1) 36 | #include 37 | class Shield80286; 38 | using ShieldType = Shield80286; 39 | #elif defined(SHIELD_386EX_V1) || defined(SHIELD_386EX_V2) 40 | #include 41 | class Shield80386; 42 | using ShieldType = Shield80386; 43 | #else 44 | #error "You must define a shield type!" 45 | #endif 46 | -------------------------------------------------------------------------------- /shields/386EX/README.md: -------------------------------------------------------------------------------- 1 | ## ArduinoX86 386EX Shield 2 | 3 | ![386ex_hat](./images/386ex_hat.jpg) 4 | 5 | This is a shield for the 386EX CPU. The 386EX is a low-voltage variant of the 386 with a 16-bit data bus, intended for 6 | embedded applications. 7 | 8 | This shield has external power pins. You may connect a 3.3V or 5V power source to the pins. 9 | I recommend using Dupont connectors. 10 | 11 | In my observation, 5V 386EX CPUs seem to run fine at 3.3V as well, although this may not be the case at higher clock 12 | rates. 13 | 14 | You may find that the CPU runs even without external power. This is due to the CMOS process - many CMOS CPUs can power 15 | themselves by sinking current from any input pin. Correct operation in this state is not guaranteed. 16 | 17 | This shield should be compatible with the Arduino Due and GIGA. If using a Due, do not supply more than 3.3V to the HAT. 18 | 19 | Unsoldered new-old-stock 386EX chips are often available on eBay. If using a donor board, a hot plate or hot-air 20 | station will be necessary to successfully remove the CPU without damage. 21 | 22 | > [!WARNING] 23 | > Successfully assembling this board requires advanced soldering skills. A solder mask, paste and hot plate are 24 | > recommended, or solid experience in drag-soldering techniques. 25 | 26 | ## BOM 27 | 28 | - (1x) 386EX CPU in PQFP-132 footprint 29 | - (12x) 0603 0.047uf bypass capacitors 30 | - (1x) 1x2 2.54mm pin headers (horizontal or vertical, trim to size) 31 | - A set of Arduino MEGA-footprint stacking headers 32 | https://www.amazon.com/Treedix-Stacking-Headers-Stackable-Compatible/dp/B08G4FGBPQ 33 | - (1x) 750Ohm resistor (for LED) 34 | https://www.mouser.com/ProductDetail/667-ERA-6AED751V 35 | 36 | - (1x) Any 0805 ~2V LED of your choice with 1.8-1.9mA forward current 37 | - https://www.mouser.com/ProductDetail/604-APTD2012LCGCK (Green) 38 | - https://www.mouser.com/ProductDetail/604-APT2012LSECKJ4RV (Orange) 39 | 40 | - RS232 board for debug output such as MAX3232 or the like -------------------------------------------------------------------------------- /sketches/cpu_server/hats/HatTraits.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | // Define the baud rate to use for the RS232 module plugged into your hat 26 | // (or possibly directly into your Arduino, but in this case our "hat" is 27 | // the specific pinout template. 28 | 29 | struct Hat8088; 30 | struct Hat80186; 31 | 32 | template 33 | struct HatTraits { 34 | static constexpr unsigned long kDebugBaudRate = 115200; // Default baud rate 35 | }; 36 | 37 | // Specialize for Hat8088 38 | template<> 39 | struct HatTraits { 40 | static constexpr unsigned long kDebugBaudRate = 460800; 41 | }; 42 | 43 | // Specialize for Hat80186 44 | template<> 45 | struct HatTraits { 46 | static constexpr unsigned long kDebugBaudRate = 460800; 47 | }; -------------------------------------------------------------------------------- /platformio/ArduinoX86/include/CpuTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | enum class FpuType : uint8_t { 29 | noFpu, 30 | i8087, 31 | }; 32 | 33 | enum class CpuBusWidth : uint8_t { 34 | Eight, 35 | Sixteen, 36 | }; 37 | 38 | // Type of CPU. These are either detected or specified by the configured shield. 39 | enum class CpuType : uint8_t { 40 | Undetected, 41 | i8088, 42 | i8086, 43 | necV20, 44 | necV30, 45 | i80188, 46 | i80186, 47 | i80286, 48 | i80386, 49 | }; 50 | 51 | struct CpuResetResult { 52 | bool success; // True if reset was successful 53 | BusWidth busWidth; // The bus width detected (Eight or Sixteen) 54 | bool queueStatus; // True if queue status lines are available 55 | }; 56 | 57 | -------------------------------------------------------------------------------- /sketches/cpu_server/hats/Hat80186.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | 26 | #include "../hat_config.h" 27 | #include "../gpio_pins.h" 28 | 29 | struct Hat80188 { 30 | static constexpr unsigned ClockDivisor = 2; 31 | static constexpr unsigned ClockHighDelay = 0; 32 | static constexpr unsigned ClockLowDelay = 0; 33 | 34 | template 35 | inline static void cpuTick(Board& board) { 36 | WRITE_PIN_D04(1); 37 | if (ClockHighDelay > 0) { 38 | board.clockHighDelay(); 39 | } 40 | WRITE_PIN_D04(0); 41 | if (ClockLowDelay > 0) { 42 | board.clockLowDelay(); 43 | } 44 | WRITE_PIN_D04(1); 45 | if (ClockHighDelay > 0) { 46 | board.clockHighDelay(); 47 | } 48 | WRITE_PIN_D04(0); 49 | if (ClockLowDelay > 0) { 50 | board.clockLowDelay(); 51 | } 52 | } 53 | }; -------------------------------------------------------------------------------- /crates/arduinox86_cpu/examples/cpu_id.rs: -------------------------------------------------------------------------------- 1 | /* 2 | Arduino8088 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduino_8088 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | use arduinox86_client::*; 24 | 25 | fn main() { 26 | env_logger::init(); 27 | 28 | // Create a cpu_client connection to cpu_server. 29 | let mut cpu_client = match CpuClient::init(None, None) { 30 | Ok(ard_client) => { 31 | println!("Opened connection to Arduino_808X server!"); 32 | ard_client 33 | } 34 | Err(e) => { 35 | eprintln!("Error connecting to Arduino_808X server: {e}"); 36 | std::process::exit(1); 37 | } 38 | }; 39 | 40 | match cpu_client.cpu_type() { 41 | Ok(cpu_id) => { 42 | println!("Detected CPU: {:?}", cpu_id); 43 | } 44 | Err(e) => { 45 | eprintln!("Error detecting CPU: {e}"); 46 | std::process::exit(1); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /sketches/cpu_server/boards/BoardTraits.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | 26 | // Default generic trait template - invalid pins by default 27 | template 28 | struct BoardTraits { 29 | static constexpr int _DBUS_01 = 0; 30 | static constexpr int _CLK_PIN = 0; 31 | // Add other default traits here 32 | }; 33 | 34 | // Forward declare board classes 35 | template 36 | class ArduinoDueBoard; 37 | 38 | template 39 | class ArduinoGigaBoard; 40 | 41 | // Specialization for ArduinoDueBoard 42 | template 43 | struct BoardTraits> { 44 | static constexpr int _DBUS_01 = 23; 45 | static constexpr int _CLK_PIN = 4; 46 | }; 47 | 48 | // Specialization for ArduinoGigaBoard 49 | template 50 | struct BoardTraits> { 51 | static constexpr int _DBUS_01 = 23; 52 | static constexpr int _CLK_PIN = 4; 53 | }; 54 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/include/boards/BoardTraits.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | 26 | // Default generic trait template - invalid pins by default 27 | template 28 | struct BoardTraits { 29 | static constexpr int _DBUS_01 = 0; 30 | static constexpr int _CLK_PIN = 0; 31 | // Add other default traits here 32 | }; 33 | 34 | // Forward declare board classes 35 | template 36 | class ArduinoDueBoard; 37 | 38 | template 39 | class ArduinoGigaBoard; 40 | 41 | // Specialization for ArduinoDueBoard 42 | template 43 | struct BoardTraits> { 44 | static constexpr int _DBUS_01 = 23; 45 | static constexpr int _CLK_PIN = 4; 46 | }; 47 | 48 | // Specialization for ArduinoGigaBoard 49 | template 50 | struct BoardTraits> { 51 | static constexpr int _DBUS_01 = 23; 52 | static constexpr int _CLK_PIN = 4; 53 | }; 54 | -------------------------------------------------------------------------------- /shields/808x/gerbers/ard8088-F_Paste.gtp: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,(6.0.7)*% 2 | %TF.CreationDate,2024-05-09T09:52:52-04:00*% 3 | %TF.ProjectId,ard8088,61726438-3038-4382-9e6b-696361645f70,1.1*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Paste,Top*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW (6.0.7)) date 2024-05-09 09:52:52* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | G04 Aperture macros list* 15 | %AMRoundRect* 16 | 0 Rectangle with rounded corners* 17 | 0 $1 Rounding radius* 18 | 0 $2 $3 $4 $5 $6 $7 $8 $9 X,Y pos of 4 corners* 19 | 0 Add a 4 corners polygon primitive as box body* 20 | 4,1,4,$2,$3,$4,$5,$6,$7,$8,$9,$2,$3,0* 21 | 0 Add four circle primitives for the rounded corners* 22 | 1,1,$1+$1,$2,$3* 23 | 1,1,$1+$1,$4,$5* 24 | 1,1,$1+$1,$6,$7* 25 | 1,1,$1+$1,$8,$9* 26 | 0 Add four rect primitives between the rounded corners* 27 | 20,1,$1+$1,$2,$3,$4,$5,0* 28 | 20,1,$1+$1,$4,$5,$6,$7,0* 29 | 20,1,$1+$1,$6,$7,$8,$9,0* 30 | 20,1,$1+$1,$8,$9,$2,$3,0*% 31 | G04 Aperture macros list end* 32 | %ADD10RoundRect,0.250000X0.350000X0.450000X-0.350000X0.450000X-0.350000X-0.450000X0.350000X-0.450000X0*% 33 | %ADD11RoundRect,0.250000X-0.325000X-0.450000X0.325000X-0.450000X0.325000X0.450000X-0.325000X0.450000X0*% 34 | %ADD12RoundRect,0.250000X-0.450000X0.350000X-0.450000X-0.350000X0.450000X-0.350000X0.450000X0.350000X0*% 35 | %ADD13RoundRect,0.250000X-0.337500X-0.475000X0.337500X-0.475000X0.337500X0.475000X-0.337500X0.475000X0*% 36 | %ADD14RoundRect,0.250000X-0.450000X0.325000X-0.450000X-0.325000X0.450000X-0.325000X0.450000X0.325000X0*% 37 | G04 APERTURE END LIST* 38 | D10* 39 | %TO.C,R2*% 40 | X118775000Y-109220000D03* 41 | X116775000Y-109220000D03* 42 | %TD*% 43 | D11* 44 | %TO.C,D2*% 45 | X112005000Y-109220000D03* 46 | X114055000Y-109220000D03* 47 | %TD*% 48 | D12* 49 | %TO.C,R1*% 50 | X176906289Y-109220000D03* 51 | X176906289Y-111220000D03* 52 | %TD*% 53 | D13* 54 | %TO.C,C1*% 55 | X101351574Y-72254984D03* 56 | X103426574Y-72254984D03* 57 | %TD*% 58 | D14* 59 | %TO.C,D1*% 60 | X179070000Y-109213995D03* 61 | X179070000Y-111263995D03* 62 | %TD*% 63 | M02* 64 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/include/programs.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | 29 | extern InlineProgram SETUP_PROGRAM_86; 30 | extern InlineProgram SETUP_PROGRAM_186; 31 | extern InlineProgram SETUP_PROGRAM_386EX; 32 | extern InlineProgram LOAD_PROGRAM; 33 | extern InlineProgram LOAD_PROGRAM_286; 34 | extern InlineProgram LOAD_PROGRAM_386; 35 | extern InlineProgram LOAD_PROGRAM_SMM_386; 36 | extern InlineProgram CPUID_PROGRAM; 37 | extern InlineProgram EMU_ENTER_PROGRAM; 38 | extern InlineProgram EMU_EXIT_PROGRAM; 39 | extern InlineProgram JUMP_VECTOR; 40 | extern InlineProgram NMI_VECTOR; 41 | extern InlineProgram STOREALL_PROGRAM; 42 | extern InlineProgram STOREALL_PROGRAM_386; 43 | extern InlineProgram STORE_PROGRAM_NMI; 44 | extern InlineProgram STORE_PROGRAM_NMI_386; 45 | extern InlineProgram STORE_PROGRAM_INLINE; 46 | extern InlineProgram NEC_PREFETCH_PROGRAM; 47 | 48 | #define NMI_VECTOR_SIZE 4 -------------------------------------------------------------------------------- /platformio/ArduinoX86/include/globals.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | template class BoardController; 32 | template class CommandServer; 33 | 34 | extern Cpu CPU; 35 | extern Intel8288 I8288; 36 | extern BoardController Controller; 37 | 38 | namespace ArduinoX86 { 39 | extern CommandServer Server; 40 | extern BusEmulator *Bus; 41 | extern CycleStateLogger *CycleLogger; 42 | } 43 | 44 | extern bool screen_init_requested; 45 | 46 | // cpu_server.cpp 47 | extern const char RESPONSE_CHRS[]; 48 | extern const char VERSION_DAT[]; 49 | extern const size_t VERSION_DAT_LEN; 50 | extern const char MACHINE_STATE_CHARS[]; 51 | extern const char * const MACHINE_STATE_STRINGS[]; 52 | extern const char * const CMD_STRINGS[]; -------------------------------------------------------------------------------- /crates/arduinox86_egui/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "arduinox86_egui" 3 | version = "0.1.0" 4 | authors = ["Daniel Balsom"] 5 | edition = "2021" 6 | include = ["LICENSE", "**/*.rs", "Cargo.toml"] 7 | rust-version = "1.81" 8 | 9 | [package.metadata.docs.rs] 10 | all-features = true 11 | targets = ["x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu"] 12 | 13 | [dependencies] 14 | egui = "0.32" 15 | eframe = { version = "0.32", default-features = false, features = [ 16 | "accesskit", # Make egui compatible with screen readers. NOTE: adds a lot of dependencies. 17 | "default_fonts", # Embed the default egui fonts. 18 | "glow", # Use the glow rendering backend. Alternative: "wgpu". 19 | "persistence", # Enable restoring app state when restarting the app. 20 | "wayland", # To support Linux (and CI) 21 | ] } 22 | egui_extras = { version = "0.32", default-features = false, features = ["serde", "syntect"] } 23 | egui-notify = "0.20" 24 | syntect = { version = "5", default-features = false } 25 | log = "0.4" 26 | wgpu = "25" 27 | toml.workspace = true 28 | image = { version = "0.25", default-features = false, features = ["png"] } 29 | rfd = "0.15" 30 | tempfile.workspace = true 31 | uuid.workspace = true 32 | serde = { version = "1", features = ["derive"] } 33 | env_logger = "0.11" 34 | serialport = "4.2" 35 | anyhow = "1.0" 36 | strum = "0.26" 37 | strum_macros = "0.26" 38 | pollster.workspace = true 39 | crossbeam-channel.workspace = true 40 | egui-phosphor.workspace = true 41 | 42 | # internal crate dependencies 43 | arduinox86_client = { path = "../arduinox86_client" } 44 | clap = { version = "4.5.37", features = ["derive"] } 45 | 46 | 47 | [profile.release] 48 | opt-level = 2 # fast and small wasm 49 | 50 | # Optimize all dependencies even in debug builds: 51 | [profile.dev.package."*"] 52 | opt-level = 2 53 | 54 | 55 | [patch.crates-io] 56 | 57 | # If you want to use the bleeding edge version of egui and eframe: 58 | # egui = { git = "https://github.com/emilk/egui", branch = "master" } 59 | # eframe = { git = "https://github.com/emilk/egui", branch = "master" } 60 | 61 | # If you fork https://github.com/emilk/egui you can test with: 62 | # egui = { path = "../egui/crates/egui" } 63 | # eframe = { path = "../egui/crates/eframe" } 64 | -------------------------------------------------------------------------------- /shields/386EX_V4/README.md: -------------------------------------------------------------------------------- 1 | ## ArduinoX86 386EX Shield V4 2 | 3 | ![386ex_v4_shield](./images/386ex_v4_render_01.png) 4 | 5 | This is the latest shield design for the 386EX CPU. It supports the addition of a 387SX FPU via stacking headers. 6 | The 386EX is a low-voltage variant of the 386 with a 16-bit data bus, intended for embedded applications. 7 | 8 | This shield has external power pins. You may connect a 3.3V or 5V power source to the pins. I recommend using Dupont 9 | connectors. 10 | 11 | You may find that the CPU runs even without external power. This is due to the CMOS process - many CMOS CPUs can power 12 | themselves by sinking current from any input pin. Correct operation in this state is not guaranteed. 13 | 14 | This shield should be compatible with the Arduino Due and GIGA. If using a Due, do not supply more than 3.3V to the 15 | external power pins, or you will damage your Arduino Due. 16 | 17 | Unsoldered new-old-stock 386EX chips are often available on eBay. If using a donor board, a hot plate or hot-air 18 | station will be necessary to successfully remove the CPU without damage. 19 | 20 | This shield adds new features over the original: 21 | 22 | - PEREQ and ERROR pins have been connected to support stacking a 387SX 23 | - The SMI and SMIACT pins have been connected 24 | - The JTAG ports have been run out to a 2x4 header 25 | - The first Asynchronous serial port has been run out to a 2x5 header (Serial0) 26 | - The first 8 external INTR lines (INTR0-INTR7) have been run out to separate 1x4 headers 27 | - 7 status LEDs have been added that will report the status of SMIACT, ADS, RD, WR, W/R, C/M and M/IO. 28 | 29 | Improvements over the previous design include: 30 | 31 | - Series termination resistor on the clock line 32 | - Optional filter caps on the external power connector 33 | - Larger Schmitt-triggered inverter chip to invert the D/C and M/IO LED logic states 34 | - Test probe pads for the clock line near the CPU 35 | - I2C EEPROM for automatic board identification and write-protect jumper 36 | 37 | > [!WARNING] 38 | > Successfully assembling this board requires advanced soldering skills. A solder mask, paste and hot plate are 39 | > recommended, or solid experience in drag-soldering techniques. 40 | 41 | ## BOM 42 | 43 | - TBD -------------------------------------------------------------------------------- /platformio/ArduinoX86/src/globals.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | extern uint8_t PACKET_BUFFER[PACKET_SIZE]; // Packet buffer for serial communication 29 | 30 | #if defined(SHIELD_8088_V1) 31 | #include 32 | 33 | // Define the static constexpr members of Shield8088 34 | constexpr std::array Shield8088::OUTPUT_PINS; 35 | constexpr std::array Shield8088::INPUT_PINS; 36 | #endif 37 | 38 | #if defined(SHIELD_286_5V_V1) 39 | #include 40 | 41 | // Define the static constexpr members of Shield80286 42 | constexpr std::array Shield80286::OUTPUT_PINS; 43 | constexpr std::array Shield80286::INPUT_PINS; 44 | #endif 45 | 46 | #if defined(SHIELD_386EX_V1) || defined(SHIELD_386EX_V2) 47 | #include 48 | 49 | // Define the static constexpr members of Shield80386 50 | constexpr std::array Shield80386::OUTPUT_PINS; 51 | constexpr std::array Shield80386::INPUT_PINS; 52 | #endif -------------------------------------------------------------------------------- /crates/arduinox86_egui/src/main.rs: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | #![warn(clippy::all, rust_2018_idioms)] 24 | //#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release 25 | 26 | use arduinox86_egui::App; 27 | 28 | fn main() -> eframe::Result { 29 | env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`). 30 | 31 | log::debug!("Starting ArduinoX86 GUI..."); 32 | let native_options = eframe::NativeOptions { 33 | viewport: egui::ViewportBuilder::default() 34 | .with_inner_size([400.0, 300.0]) 35 | .with_min_inner_size([300.0, 220.0]) 36 | .with_icon( 37 | // NOTE: Adding an icon is optional 38 | eframe::icon_data::from_png_bytes(&include_bytes!("../assets/icon-256.png")[..]) 39 | .expect("Failed to load icon"), 40 | ), 41 | ..Default::default() 42 | }; 43 | eframe::run_native( 44 | "ArduinoX86 GUI", 45 | native_options, 46 | Box::new(|cc| Ok(Box::new(App::new(cc)))), 47 | ) 48 | } 49 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/src/opcodes.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | #pragma once 24 | 25 | #define OPCODE_HALT 0xF4 26 | #define OPCODE_DOUBLE_HALT 0xF4F4 // For 386, which only fetches at even addresses 27 | #define OPCODE_NOP 0x90 28 | #define OPCODE_80NOP 0x00 29 | #define OPCODE_DOUBLENOP 0x9090 30 | #define OPCODE_DOUBLE_80NOP 0x0000 31 | 32 | #define MODRM_OP(M) (((M & 0b00111000) >> 3) & 0x07) 33 | 34 | #define GRP1 105 35 | #define GRP2A 106 36 | #define GRP2B 110 37 | #define GRP3 107 38 | #define GRP4 108 39 | #define GRP5 109 40 | #define IS_GRP_OP(O) ((OPCODE_REFS[O] >= GRP1) && (OPCODE_REFS[O] <= GRP2B)) 41 | 42 | extern const char * const OPCODE_STRS[]; 43 | extern const char * const OPCODE_STRS_GRP1[]; 44 | extern const char * const OPCODE_STRS_GRP2A[]; 45 | extern const char * const OPCODE_STRS_GRP2B[]; 46 | extern const char * const OPCODE_STRS_GRP3[]; 47 | extern const char * const OPCODE_STRS_GRP4[]; 48 | extern const char * const OPCODE_STRS_GRP5[]; 49 | extern const char * const OPCODE_8080_STRS[]; 50 | extern const uint8_t OPCODE_REFS[]; 51 | extern const uint8_t OPCODE_8080_REFS[]; 52 | -------------------------------------------------------------------------------- /asm/demos/starpath.asm: -------------------------------------------------------------------------------- 1 | ; starpath.asm 2 | ; by HellMood/DSR 3 | ; https://www.pouet.net/prod.php?which=103622 4 | ; Compile with nasm to build program.bin for cpu_client 5 | ; nasm program.asm -o program.bin 6 | cpu 386 7 | org 100h 8 | 9 | %define DOS 1 10 | 11 | start: 12 | push 0xa000 ; let ES point to 0xA000 13 | pop es ; start of VGA Video RAM 14 | mov al,0x13 ; mode 13h, 320x200 pixels, 256 colors 15 | %if DOS 16 | int 10h ; set graphic mode 17 | %endif 18 | X: 19 | mov bl,14 ; start depth at 14 20 | L: 21 | mov ax,0xcccd ; Rrrola constant 22 | mul di ; Getting X,Y in DL,DH 23 | mov al,dh ; getting Y into AL 24 | mul bl ; multiply Y by current depth (into AH) 25 | xchg ax,dx ; store Y' into DH, get X into AL 26 | sub al,bl ; curve X by the current depth 27 | jc W ; if left of the curve, jump to "sky" 28 | mul bl ; multiply X by current depth (into AH) 29 | mov al,dh ; get Y' in AL (now AL,AH = Y',X') 30 | or al,ah ; OR for geometry and texture pattern 31 | lea dx,[bx+si] ; get (current depth) + (current frame count) in DX (DL) 32 | and ax,dx ; mask geometry/texture by time shifted depth... 33 | inc bx ; (increment depth by one) 34 | test al,16 ; ... to create "gaps" 35 | jz L ; if ray did not hit, repeat pixel loop 36 | jmp short Q ; jump over the sky ^^ 37 | W: 38 | mov al,27 ; is both the star color and palette offset into sky 39 | add dl,cl ; pseudorandom multiplication leftover DL added 40 | jz Q ; to shifted depth, 1 in 256 chance to be a star * 41 | shld ax,di,4 ; if not, shift the starcolor and add scaled pixel count 42 | Q: 43 | stosb ; write pixel to RAM, advance pixel counter 44 | inc di ; increment pixel counter twice 45 | inc di ; for a slightly smoother animation 46 | loop X ; repeat for 64k pixels 47 | inc si ; increment frame counter 48 | %if DOS 49 | hlt ; synced against timer, wait (18.2 FPS) 50 | in ax,0x60 ; read keyboard 51 | dec ax ; check for ESC 52 | jnz X 53 | %else 54 | jmp X ; if not, repeat process 55 | %endif 56 | ret ; quit program 57 | 58 | 59 | -------------------------------------------------------------------------------- /crates/test_generator/src/flags.rs: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | #![allow(dead_code)] 24 | pub const CPU_FLAG_CARRY: u16 = 0b0000_0000_0000_0001; 25 | pub const CPU_FLAG_RESERVED1: u16 = 0b0000_0000_0000_0010; 26 | pub const CPU_FLAG_PARITY: u16 = 0b0000_0000_0000_0100; 27 | pub const CPU_FLAG_RESERVED3: u16 = 0b0000_0000_0000_1000; 28 | pub const CPU_FLAG_AUX_CARRY: u16 = 0b0000_0000_0001_0000; 29 | pub const CPU_FLAG_RESERVED5: u16 = 0b0000_0000_0010_0000; 30 | pub const CPU_FLAG_ZERO: u16 = 0b0000_0000_0100_0000; 31 | pub const CPU_FLAG_SIGN: u16 = 0b0000_0000_1000_0000; 32 | pub const CPU_FLAG_TRAP: u16 = 0b0000_0001_0000_0000; 33 | pub const CPU_FLAG_INT_ENABLE: u16 = 0b0000_0010_0000_0000; 34 | pub const CPU_FLAG_DIRECTION: u16 = 0b0000_0100_0000_0000; 35 | pub const CPU_FLAG_OVERFLOW: u16 = 0b0000_1000_0000_0000; 36 | pub const CPU_FLAG_F15: u16 = 0b1000_0000_0000_0000; // Reserved bit 15 37 | pub const CPU_FLAG_MODE: u16 = 0b1000_0000_0000_0000; 38 | pub const CPU_FLAG_NT: u16 = 0b0100_0000_0000_0000; // Nested Task 39 | pub const CPU_FLAG_IOPL0: u16 = 0b0001_0000_0000_0000; // Nested Task 40 | pub const CPU_FLAG_IOPL1: u16 = 0b0010_0000_0000_0000; // Nested Task 41 | -------------------------------------------------------------------------------- /sketches/cpu_server/boards/ArduinoDueBoard.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include "../gpio_pins.h" // Your GPIO macros like WRITE_PIN_D04, etc. 28 | #include "../hat_config.h" // Board-specific configuration and pin mappings 29 | 30 | #include "../DebugPrint.h" // Debug print mixin 31 | #include "../hats/HatTraits.h" // Hat-specific traits 32 | template 33 | class ArduinoDueBoard : public DebugPrintMixin { 34 | public: 35 | ArduinoDueBoard() : DebugPrintMixin(Serial1) {} 36 | 37 | void init() { 38 | pinMode(4, OUTPUT); // CLK_PIN (could also be from BoardTraits if you want) 39 | // Initialize other pins as needed... 40 | 41 | Serial1.begin(HatTraits::kDebugBaudRate); 42 | } 43 | 44 | inline void clockHighDelay() { 45 | // Board-specific tuning. in this case do nothing! 46 | } 47 | 48 | inline void clockLowDelay() { 49 | // Board-specific timing. In this case do nothing! 50 | } 51 | 52 | void digitalWritePin(int pin, bool val) { 53 | digitalWrite(pin, val ? HIGH : LOW); 54 | } 55 | 56 | bool digitalReadPin(int pin) { 57 | return digitalRead(pin) == HIGH; 58 | } 59 | 60 | 61 | }; -------------------------------------------------------------------------------- /sketches/cpu_server/boards/ArduinoGigaBoard.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include "../gpio_pins.h" // Your GPIO macros like WRITE_PIN_D04, etc. 28 | #include "../hat_config.h" // Board-specific configuration and pin mappings 29 | 30 | #include "../DebugPrint.h" // Debug print mixin 31 | #include "../hats/HatTraits.h" // Hat-specific traits 32 | 33 | template 34 | class ArduinoGigaBoard : public DebugPrintMixin { 35 | public: 36 | ArduinoGigaBoard() : DebugPrintMixin(Serial1) {} 37 | 38 | void init() { 39 | pinMode(4, OUTPUT); // CLK_PIN (could also be from BoardTraits if you want) 40 | // Initialize other pins as needed... 41 | 42 | Serial1.begin(HatTraits::kDebugBaudRate); 43 | } 44 | 45 | inline void clockHighDelay() { 46 | // Board-specific tuning. in this case do nothing! 47 | } 48 | 49 | inline void clockLowDelay() { 50 | // Board-specific timing. In this case do nothing! 51 | } 52 | 53 | void digitalWritePin(int pin, bool val) { 54 | digitalWrite(pin, val ? HIGH : LOW); 55 | } 56 | 57 | bool digitalReadPin(int pin) { 58 | return digitalRead(pin) == HIGH; 59 | } 60 | 61 | 62 | }; -------------------------------------------------------------------------------- /platformio/ArduinoX86/include/shields/ShieldTraits.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | #pragma once 24 | // Define the baud rate to use for the RS232 module plugged into your shield 25 | // (or possibly directly into your Arduino, but in this case our "shield" is 26 | // the specific pinout template. 27 | 28 | #include 29 | 30 | class Shield8088; 31 | class Shield80186; 32 | class Shield80286; 33 | class Shield80386; 34 | 35 | template 36 | struct ShieldTraits { 37 | static constexpr unsigned long kDebugBaudRate = DEBUG_BAUD_RATE; // Default baud rate 38 | }; 39 | 40 | // Specialize for Shield8088 41 | template<> 42 | struct ShieldTraits { 43 | static constexpr unsigned long kDebugBaudRate = DEBUG_BAUD_RATE; 44 | }; 45 | 46 | // Specialize for Shield80186 47 | template<> 48 | struct ShieldTraits { 49 | static constexpr unsigned long kDebugBaudRate = DEBUG_BAUD_RATE; 50 | }; 51 | 52 | // Specialize for Shield80286 53 | template<> 54 | struct ShieldTraits { 55 | static constexpr unsigned long kDebugBaudRate = DEBUG_BAUD_RATE; 56 | }; 57 | 58 | // Specialize for Shield80386 59 | template<> 60 | struct ShieldTraits { 61 | static constexpr unsigned long kDebugBaudRate = DEBUG_BAUD_RATE; 62 | }; -------------------------------------------------------------------------------- /sketches/cpu_server/ansi_color.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | // This module has some helpers for emitting ANSI color on the debugging 25 | // serial port on the Arduino DUE, SER_DEBUG 26 | 27 | #ifndef _ARDUINO_ANSI_COLOR_H 28 | #define _ARDUINO_ANSI_COLOR_H 29 | 30 | namespace ansi { 31 | // Normal colors 32 | constexpr const char* black = "\x1b[30m"; 33 | constexpr const char* red = "\x1b[31m"; 34 | constexpr const char* green = "\x1b[32m"; 35 | constexpr const char* yellow = "\x1b[33m"; 36 | constexpr const char* blue = "\x1b[34m"; 37 | constexpr const char* magenta= "\x1b[35m"; 38 | constexpr const char* cyan = "\x1b[36m"; 39 | constexpr const char* white = "\x1b[37m"; 40 | 41 | // Bright colors 42 | constexpr const char* bright_black = "\x1b[90m"; 43 | constexpr const char* bright_red = "\x1b[91m"; 44 | constexpr const char* bright_green = "\x1b[92m"; 45 | constexpr const char* bright_yellow = "\x1b[93m"; 46 | constexpr const char* bright_blue = "\x1b[94m"; 47 | constexpr const char* bright_magenta = "\x1b[95m"; 48 | constexpr const char* bright_cyan = "\x1b[96m"; 49 | constexpr const char* bright_white = "\x1b[97m"; 50 | 51 | // Control codes 52 | constexpr const char* reset = "\x1b[0m"; 53 | } 54 | 55 | #endif //_ARDUINO_ANSI_COLOR_H -------------------------------------------------------------------------------- /platformio/ArduinoX86/asm/store_nmi_386_real.asm: -------------------------------------------------------------------------------- 1 | ; store_nmi_386_real.asm 2 | ; Assemble with nasm: 3 | ; nasm store_nmi_386_real.asm -o store.bin 4 | 5 | ; Registers are output in turn to IO addresses that can be mapped to offsets into 6 | ; the 386 LOADALL structure. 7 | 8 | ; This routine is intended to run out of an NMI handler that terminates program 9 | ; execution. Therefore IP, CS and FLAGS can be popped from the stack. 10 | 11 | cpu 386 12 | org 0h 13 | 14 | %define IO_BASE 0x80 15 | 16 | %macro IO_OUT 2 17 | out byte IO_BASE + %1, %2 18 | %endmacro 19 | 20 | push ax 21 | mov ax, 08000h ; set ESE = 1 22 | out 23h, al ; write low byte, unlock 23 | xchg al, ah 24 | out 22h, al ; write low byte of AX 25 | out 22h, ax ; write high byte of AX (now REMAPCFG is writable) 26 | 27 | mov al, 0FFh ; Mask off all devices 28 | out 22h, al 29 | pop ax 30 | 31 | IO_OUT 0x28, eax ; EAX 32 | mov eax, cr0 ; CR0 33 | IO_OUT 0x00, eax ; CR0 34 | mov eax, ebx ; EBX 35 | IO_OUT 0x1C, eax ; EBX 36 | mov eax, ecx ; ECX 37 | IO_OUT 0x24, eax ; ECX 38 | mov eax, edx ; EDX 39 | IO_OUT 0x20, eax ; EDX 40 | mov eax, dr6 ; DR6 41 | IO_OUT 0x2C, eax ; DR6 42 | mov eax, dr7 ; DR7 43 | IO_OUT 0x30, eax ; DR7 44 | pop ax ; IP 45 | IO_OUT 0x08, ax ; IP 46 | pop ax ; CS 47 | IO_OUT 0x4C, ax ; CS 48 | pop ax ; EFlags 49 | IO_OUT 0x04, ax ; EFlags 50 | mov ax, ss ; SS 51 | IO_OUT 0x48, ax ; SS 52 | mov eax, esp ; ESP 53 | IO_OUT 0x18, eax ; ESP 54 | mov ax, ds ; DS 55 | IO_OUT 0x44, ax ; DS 56 | mov ax, es ; ES 57 | IO_OUT 0x50, ax ; ES 58 | mov ax, fs ; FS 59 | IO_OUT 0x40, ax ; FS 60 | mov ax, gs ; GS 61 | IO_OUT 0x3C, ax ; GS 62 | mov eax, ebp ; EBP 63 | IO_OUT 0x14, eax ; EBP 64 | mov eax, esi ; ESI 65 | IO_OUT 0x10, eax ; ESI 66 | mov eax, edi ; EDI 67 | IO_OUT 0x0C, eax ; EDI 68 | 69 | mov ax, 0xFFFF ; Sent as a signal to end STORE 70 | out 0xFD, ax ; Done! 71 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/include/bus_emulator/NullBackend.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | #include 26 | #include 27 | 28 | // Null backend: does nothing and returns zero 29 | class NullBackend : public IBusBackend { 30 | public: 31 | IBusBackendType type() const override { 32 | return IBusBackendType::Null; 33 | } 34 | 35 | size_t size() const override { return 0; } 36 | uint8_t read_u8(uint32_t) override { return 0; } 37 | uint16_t read_u16(uint32_t) override { return 0; } 38 | uint16_t read_bus(uint32_t, bool) override { return 0; } 39 | uint8_t *get_ptr(uint32_t) override { return NULL; } 40 | void write_u8(uint32_t, uint8_t) override {} 41 | void write_u16(uint32_t, uint16_t) override {} 42 | void write_bus(uint32_t, uint16_t, bool) override {} 43 | uint8_t io_read_u8(uint16_t) override { return 0; } 44 | uint16_t io_read_u16(uint16_t) override { return 0; } 45 | void io_write_u8(uint16_t, uint8_t) override {} 46 | void io_write_u16(uint16_t, uint16_t) override {} 47 | void set_memory(uint32_t, const uint8_t*, size_t) override {} 48 | void erase_memory() override {} 49 | void set_strategy(DefaultStrategy, uint32_t, uint32_t) override {} 50 | void randomize_memory(uint32_t) override {} 51 | void debug_mem(uint32_t, size_t) override {} 52 | }; 53 | -------------------------------------------------------------------------------- /shields/286_5V/kicad/arduino_286_5V.kicad_prl: -------------------------------------------------------------------------------- 1 | { 2 | "board": { 3 | "active_layer": 0, 4 | "active_layer_preset": "", 5 | "auto_track_width": true, 6 | "hidden_netclasses": [], 7 | "hidden_nets": [], 8 | "high_contrast_mode": 0, 9 | "net_color_mode": 1, 10 | "opacity": { 11 | "images": 0.6, 12 | "pads": 1.0, 13 | "shapes": 1.0, 14 | "tracks": 1.0, 15 | "vias": 1.0, 16 | "zones": 0.44999998807907104 17 | }, 18 | "selection_filter": { 19 | "dimensions": true, 20 | "footprints": true, 21 | "graphics": true, 22 | "keepouts": true, 23 | "lockedItems": true, 24 | "otherItems": true, 25 | "pads": true, 26 | "text": true, 27 | "tracks": true, 28 | "vias": true, 29 | "zones": true 30 | }, 31 | "visible_items": [], 32 | "visible_layers": "fffffff_ffffffff", 33 | "zone_display_mode": 0 34 | }, 35 | "git": { 36 | "repo_password": "", 37 | "repo_type": "", 38 | "repo_username": "", 39 | "ssh_key": "" 40 | }, 41 | "meta": { 42 | "filename": "arduino_286_5V.kicad_prl", 43 | "version": 3 44 | }, 45 | "net_inspector_panel": { 46 | "col_hidden": [ 47 | false, 48 | false, 49 | false, 50 | false, 51 | false, 52 | false, 53 | false, 54 | false, 55 | false, 56 | false 57 | ], 58 | "col_order": [ 59 | 0, 60 | 1, 61 | 2, 62 | 3, 63 | 4, 64 | 5, 65 | 6, 66 | 7, 67 | 8, 68 | 9 69 | ], 70 | "col_widths": [ 71 | 162, 72 | 147, 73 | 91, 74 | 67, 75 | 91, 76 | 91, 77 | 91, 78 | 71, 79 | 91, 80 | 91 81 | ], 82 | "custom_group_rules": [], 83 | "expanded_rows": [], 84 | "filter_by_net_name": true, 85 | "filter_by_netclass": true, 86 | "filter_text": "", 87 | "group_by_constraint": false, 88 | "group_by_netclass": false, 89 | "show_unconnected_nets": false, 90 | "show_zero_pad_nets": false, 91 | "sort_ascending": true, 92 | "sorting_column": 0 93 | }, 94 | "open_jobsets": [], 95 | "project": { 96 | "files": [] 97 | }, 98 | "schematic": { 99 | "selection_filter": { 100 | "graphics": true, 101 | "images": true, 102 | "labels": true, 103 | "lockedItems": false, 104 | "otherItems": true, 105 | "pins": true, 106 | "symbols": true, 107 | "text": true, 108 | "wires": true 109 | } 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/src/DebugPrint.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | #include 24 | #include 25 | #include 26 | 27 | template 28 | void DebugPrintMixin::debugPrintf(DebugType stage, bool defer, const char* fmt, ...) { 29 | if (!serial || !filter.isEnabled(stage) || !enabled_) return; 30 | 31 | va_list args; 32 | va_start(args, fmt); 33 | int n = vsnprintf(printf_buffer_, BUFFER_SIZE, fmt, args); 34 | va_end(args); 35 | if (n <= 0) return; 36 | 37 | // clamp length 38 | size_t len = size_t(n) < BUFFER_SIZE ? size_t(n) : BUFFER_SIZE - 1; 39 | printf_buffer_[len] = '\0'; 40 | 41 | const char* color = getColor(stage); 42 | const char* reset = ansi::reset; 43 | 44 | if (defer) { 45 | int w = snprintf(buffer_ptr_, 46 | buffer_remain_, 47 | "%s%.*s%s", 48 | color, 49 | int(len), 50 | printf_buffer_, 51 | reset); 52 | if (w > 0) { 53 | buffer_ptr_ += w; 54 | buffer_remain_ -= w; 55 | have_deferred_buffer_ = true; 56 | } 57 | } else { 58 | serial.print(color); 59 | serial.print(printf_buffer_); 60 | serial.print(reset); 61 | } 62 | } 63 | 64 | #if defined(ARDUINO_GIGA) 65 | template class DebugPrintMixin; 66 | #else 67 | template class DebugPrintMixin; 68 | #endif -------------------------------------------------------------------------------- /sketches/cpu_server/DebugFilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | 26 | // This module defines debug type filters so we can enable or disable specific 27 | // types of debug messages. 28 | 29 | enum class DebugType : uint32_t { 30 | STATE = 1u << 0, // DEBUG_STATE 31 | RESET = 1u << 1, // DEBUG_RESET 32 | SETUP = 1u << 2, // DEBUG_SETUP 33 | VECTOR = 1u << 3, // DEBUG_VECTOR 34 | ID = 1u << 4, // DEBUG_ID 35 | LOAD = 1u << 5, // DEBUG_LOAD 36 | LOAD_DONE = 1u << 6, // DEBUG_LOAD_DONE 37 | EXECUTE = 1u << 7, // DEBUG_EXECUTE 38 | STORE = 1u << 8, // DEBUG_STORE 39 | FINALIZE = 1u << 9, // DEBUG_FINALIZE 40 | INSTR = 1u << 10, // DEBUG_INSTR 41 | EMU = 1u << 11, // DEBUG_EMU 42 | QUEUE = 1u << 12, // DEBUG_QUEUE 43 | TSTATE = 1u << 13, // DEBUG_TSTATE 44 | PIN_CMD = 1u << 14, // DEBUG_PIN_CMD 45 | BUS = 1u << 15, // DEBUG_BUS 46 | PROTO = 1u << 16, // DEBUG_PROTO (0 in macro, but reserving bit) 47 | CMD = 1u << 17 // DEBUG_CMD (0 in macro, but reserving bit) 48 | }; 49 | 50 | class DebugFilter { 51 | uint32_t enabledTypes = 0u; // All disabled by default 52 | 53 | public: 54 | void setStageEnabled(DebugType debug_type, bool enabled) { 55 | if (enabled) 56 | enabledTypes |= static_cast(debug_type); 57 | else 58 | enabledTypes &= ~static_cast(debug_type); 59 | } 60 | 61 | bool isEnabled(DebugType debug_type) const { 62 | return (enabledTypes & static_cast(debug_type)) != 0; 63 | } 64 | }; -------------------------------------------------------------------------------- /crates/arduinox86_egui/src/range_check/mod.rs: -------------------------------------------------------------------------------- 1 | /* 2 | FluxFox 3 | https://github.com/dbalsom/fluxfox 4 | 5 | Copyright 2024-2025 Daniel Balsom 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a 8 | copy of this software and associated documentation files (the “Software”), 9 | to deal in the Software without restriction, including without limitation 10 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 11 | and/or sell copies of the Software, and to permit persons to whom the 12 | Software is furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | 25 | -------------------------------------------------------------------------- 26 | 27 | src/range_check.rs 28 | 29 | Implement an O(log n) range checker for detecting if a value is within a range. 30 | */ 31 | 32 | #[derive(Default, serde::Serialize, serde::Deserialize)] 33 | pub(crate) struct RangeChecker { 34 | events: Vec<(usize, i32, usize)>, // (value, type), where type is +1 for start, -1 for end 35 | } 36 | 37 | impl RangeChecker { 38 | pub fn new(ranges: &[(usize, usize)]) -> Self { 39 | let mut events = Vec::with_capacity(ranges.len() * 2); 40 | for (i, &(start, end)) in ranges.iter().enumerate() { 41 | events.push((start, 1, i)); // Start of range 42 | events.push((end + 1, -1, i)); // End of range, exclusive 43 | } 44 | events.sort_unstable(); 45 | RangeChecker { events } 46 | } 47 | 48 | pub fn contains(&self, value: usize) -> Option { 49 | let mut active_ranges = 0; 50 | let mut current_range = None; 51 | 52 | for &(point, event_type, range_index) in &self.events { 53 | if point > value { 54 | break; 55 | } 56 | active_ranges += event_type; 57 | if event_type == 1 { 58 | current_range = Some(range_index); // Entering a range 59 | } 60 | else if event_type == -1 && current_range == Some(range_index) { 61 | current_range = None; // Exiting the range 62 | } 63 | } 64 | 65 | if active_ranges > 0 { 66 | current_range 67 | } 68 | else { 69 | None 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /crates/arduinox86_egui/src/events.rs: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | use crate::enums::{FileOpenContext, FileSaveContext, MountAddress}; 24 | use std::path::PathBuf; 25 | 26 | #[derive(PartialEq, Eq)] 27 | pub enum GuiEvent { 28 | ResetState, 29 | LoadRegisters, 30 | EraseMemory, 31 | ReadMemory { 32 | address: u32, 33 | size: u32, 34 | }, 35 | RunProgram, 36 | AssembleProgram { 37 | program_name: String, 38 | }, 39 | PollStatus, 40 | ClearCycleLog, 41 | ToggleRefreshMemory { 42 | enabled: bool, 43 | hertz: u32, 44 | }, 45 | RefreshMemory, 46 | UploadBlob { 47 | blob_name: String, 48 | mount_address: MountAddress, 49 | size: Option, 50 | }, 51 | } 52 | 53 | #[derive(Default)] 54 | pub struct GuiEventQueue { 55 | pub events: Vec, 56 | } 57 | 58 | impl GuiEventQueue { 59 | pub fn new() -> Self { 60 | Self { events: Vec::new() } 61 | } 62 | 63 | pub fn push(&mut self, event: GuiEvent) { 64 | self.events.push(event); 65 | } 66 | 67 | pub fn pop(&mut self) -> Option { 68 | if self.events.is_empty() { 69 | None 70 | } 71 | else { 72 | Some(self.events.remove(0)) 73 | } 74 | } 75 | 76 | pub fn is_empty(&self) -> bool { 77 | self.events.is_empty() 78 | } 79 | } 80 | 81 | pub enum FrontendThreadEvent { 82 | FileOpenDialogComplete { 83 | context: FileOpenContext, 84 | path: Option, 85 | contents: Vec, 86 | }, 87 | FileSaveDialogComplete(FileSaveContext), 88 | FileOpenError(FileOpenContext, String), 89 | FileSaveError(String), 90 | FileDialogCancelled, 91 | QuitRequested, 92 | } 93 | -------------------------------------------------------------------------------- /platformio/ArduinoX86/include/DebugFilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | #pragma once 24 | #include 25 | // This module defines debug type filters so we can enable or disable specific 26 | // types of debug messages. 27 | 28 | enum class DebugType : uint32_t { 29 | WARNING = 1u, // DEBUG_WARNING (not used yet) 30 | ERROR = 1u << 1, 31 | STATE = 1u << 2, // DEBUG_STATE 32 | RESET = 1u << 3, // DEBUG_RESET 33 | SETUP = 1u << 4, // DEBUG_SETUP 34 | VECTOR = 1u << 5, // DEBUG_VECTOR 35 | ID = 1u << 6, // DEBUG_ID 36 | LOAD = 1u << 7, // DEBUG_LOAD 37 | LOAD_DONE = 1u << 8, // DEBUG_LOAD_DONE 38 | EXECUTE = 1u << 9, // DEBUG_EXECUTE 39 | STORE = 1u << 10, // DEBUG_STORE 40 | FINALIZE = 1u << 11, // DEBUG_FINALIZE 41 | INSTR = 1u << 12, // DEBUG_INSTR 42 | EMU = 1u << 13, // DEBUG_EMU 43 | QUEUE = 1u << 14, // DEBUG_QUEUE 44 | TSTATE = 1u << 15, // DEBUG_TSTATE 45 | PIN_CMD = 1u << 16, // DEBUG_PIN_CMD 46 | BUS = 1u << 17, // DEBUG_BUS 47 | PROTO = 1u << 18, // DEBUG_PROTO 48 | CMD = 1u << 19, // DEBUG_CMD 49 | DUMP = 1u << 20, // DEBUG_DUMP 50 | SERVER = 1u << 21, // DEBUG_SERVER 51 | EMIT = 1u << 23 // DEBUG_EMIT 52 | }; 53 | 54 | class DebugFilter { 55 | uint32_t enabledTypes = 1u; // All disabled by default except ERROR 56 | 57 | public: 58 | void setTypeEnabled(DebugType debug_type, bool enabled) { 59 | if (enabled) 60 | enabledTypes |= static_cast(debug_type); 61 | else 62 | enabledTypes &= ~static_cast(debug_type); 63 | } 64 | 65 | bool isEnabled(DebugType debug_type) const { 66 | return (enabledTypes & static_cast(debug_type)) != 0; 67 | } 68 | }; -------------------------------------------------------------------------------- /platformio/ArduinoX86/include/bus_emulator/IBusBackend.h: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #pragma once 25 | #include 26 | #include 27 | 28 | 29 | enum class IBusBackendType : uint8_t { 30 | Null, 31 | HashTable, 32 | Sdram, 33 | Invalid, 34 | }; 35 | 36 | // Abstract interface for bus backing implementations 37 | class IBusBackend { 38 | public: 39 | 40 | enum class DefaultStrategy: uint8_t { 41 | Random, 42 | Zero, 43 | Ones, 44 | Invalid, 45 | }; 46 | 47 | virtual IBusBackendType type() const = 0; 48 | virtual size_t size() const = 0; 49 | virtual uint8_t read_u8(uint32_t address) = 0; 50 | virtual uint16_t read_u16(uint32_t address) = 0; 51 | virtual uint16_t read_bus(uint32_t address, bool bhe) = 0; 52 | virtual uint8_t *get_ptr(uint32_t address) = 0; 53 | virtual void write_u8(uint32_t address, uint8_t value) = 0; 54 | virtual void write_u16(uint32_t address, uint16_t value) = 0; 55 | virtual void write_bus(uint32_t address, uint16_t value, bool bhe) = 0; 56 | virtual uint8_t io_read_u8(uint16_t port) = 0; 57 | virtual uint16_t io_read_u16(uint16_t port) = 0; 58 | virtual uint16_t io_read_bus(uint16_t port, bool bhe) = 0; 59 | virtual void io_write_u8(uint16_t port, uint8_t value) = 0; 60 | virtual void io_write_u16(uint16_t port, uint16_t value) = 0; 61 | virtual void io_write_bus(uint16_t port, uint16_t value, bool bhe) = 0; 62 | virtual void set_memory(uint32_t address, const uint8_t* buffer, size_t length) = 0; 63 | virtual void erase_memory() = 0; 64 | virtual void set_strategy(DefaultStrategy strategy, uint32_t start, uint32_t end) = 0; 65 | virtual void randomize_memory(uint32_t seed) = 0; 66 | virtual void debug_mem(uint32_t address, size_t length) = 0; 67 | 68 | virtual ~IBusBackend() {} 69 | }; -------------------------------------------------------------------------------- /platformio/ArduinoX86/include/StaticHashTable.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #ifdef ARDUINO_GIGA 8 | #include 9 | #define HT_ALLOC(sz) SDRAM.malloc(sz) 10 | #define HT_FREE(ptr) SDRAM.free(ptr) 11 | #else 12 | #include 13 | #define HT_ALLOC(sz) malloc(sz) 14 | #define HT_FREE(ptr) free(ptr) 15 | #endif 16 | 17 | template 18 | struct DefaultHash { 19 | size_t operator()(Key key, uint8_t shift) const { 20 | return (static_cast(key) * 2654435769u) >> shift; 21 | } 22 | }; 23 | 24 | template> 25 | class StaticHashTable { 26 | public: 27 | struct Entry { 28 | Key key; 29 | Value value; 30 | bool in_use; 31 | }; 32 | 33 | explicit StaticHashTable(size_t capacity) 34 | : capacity_(capacity), count_(0) 35 | { 36 | if ((capacity_ & (capacity_ - 1)) != 0) { 37 | assert(!"Hash table capacity must be a power of two"); 38 | entry_pool_ = nullptr; 39 | return; 40 | } 41 | 42 | shift_ = 32 - __builtin_ctz(capacity_); 43 | entry_pool_ = static_cast(HT_ALLOC(sizeof(Entry) * capacity_)); 44 | if (entry_pool_) { 45 | memset(entry_pool_, 0, sizeof(Entry) * capacity_); 46 | } 47 | } 48 | 49 | ~StaticHashTable() { 50 | if (entry_pool_) { 51 | HT_FREE(entry_pool_); 52 | } 53 | } 54 | 55 | bool insert(Key key, Value value) { 56 | if (!entry_pool_) return false; 57 | 58 | size_t index = hasher_(key, shift_); 59 | for (size_t i = 0; i < capacity_; ++i) { 60 | Entry &entry = entry_pool_[index]; 61 | if (!entry.in_use || entry.key == key) { 62 | entry.key = key; 63 | entry.value = value; 64 | if (!entry.in_use) { 65 | entry.in_use = true; 66 | ++count_; 67 | } 68 | return true; 69 | } 70 | index = (index + 1) & (capacity_ - 1); 71 | } 72 | return false; 73 | } 74 | 75 | bool find(Key key, Value &value_out) const { 76 | if (!entry_pool_) return false; 77 | 78 | size_t index = hasher_(key, shift_); 79 | for (size_t i = 0; i < capacity_; ++i) { 80 | const Entry &entry = entry_pool_[index]; 81 | if (!entry.in_use) return false; 82 | if (entry.key == key) { 83 | value_out = entry.value; 84 | return true; 85 | } 86 | index = (index + 1) & (capacity_ - 1); 87 | } 88 | return false; 89 | } 90 | 91 | void clear() { 92 | if (entry_pool_) { 93 | memset(entry_pool_, 0, sizeof(Entry) * capacity_); 94 | count_ = 0; 95 | } 96 | } 97 | 98 | size_t size() const { return count_; } 99 | size_t capacity() const { return capacity_; } 100 | 101 | private: 102 | Entry *entry_pool_ = nullptr; 103 | size_t capacity_; 104 | size_t count_; 105 | uint8_t shift_; 106 | HashFn hasher_; 107 | }; -------------------------------------------------------------------------------- /shields/808x/kicad/arduino_808x_v3.kicad_prl: -------------------------------------------------------------------------------- 1 | { 2 | "board": { 3 | "active_layer": 2, 4 | "active_layer_preset": "All Layers", 5 | "auto_track_width": true, 6 | "hidden_netclasses": [], 7 | "hidden_nets": [], 8 | "high_contrast_mode": 0, 9 | "net_color_mode": 1, 10 | "opacity": { 11 | "images": 0.6, 12 | "pads": 1.0, 13 | "shapes": 1.0, 14 | "tracks": 1.0, 15 | "vias": 1.0, 16 | "zones": 0.6 17 | }, 18 | "ratsnest_display_mode": 0, 19 | "selection_filter": { 20 | "dimensions": true, 21 | "footprints": true, 22 | "graphics": true, 23 | "keepouts": true, 24 | "lockedItems": false, 25 | "otherItems": false, 26 | "pads": true, 27 | "text": true, 28 | "tracks": true, 29 | "vias": true, 30 | "zones": true 31 | }, 32 | "visible_items": [ 33 | "vias", 34 | "footprint_text", 35 | "footprint_anchors", 36 | "ratsnest", 37 | "footprints_front", 38 | "footprints_back", 39 | "footprint_values", 40 | "footprint_references", 41 | "tracks", 42 | "drc_errors", 43 | "drawing_sheet", 44 | "bitmaps", 45 | "pads", 46 | "zones", 47 | "drc_warnings", 48 | "shapes" 49 | ], 50 | "visible_layers": "ffffffff_ffffffff_ffffffff_ffffffff", 51 | "zone_display_mode": 0 52 | }, 53 | "git": { 54 | "repo_password": "", 55 | "repo_type": "", 56 | "repo_username": "", 57 | "ssh_key": "" 58 | }, 59 | "meta": { 60 | "filename": "arduino_808x_v3.kicad_prl", 61 | "version": 5 62 | }, 63 | "net_inspector_panel": { 64 | "col_hidden": [ 65 | false, 66 | false, 67 | false, 68 | false, 69 | false, 70 | false, 71 | false, 72 | false, 73 | false, 74 | false 75 | ], 76 | "col_order": [ 77 | 0, 78 | 1, 79 | 2, 80 | 3, 81 | 4, 82 | 5, 83 | 6, 84 | 7, 85 | 8, 86 | 9 87 | ], 88 | "col_widths": [ 89 | 162, 90 | 147, 91 | 91, 92 | 67, 93 | 91, 94 | 91, 95 | 91, 96 | 71, 97 | 91, 98 | 91 99 | ], 100 | "custom_group_rules": [], 101 | "expanded_rows": [], 102 | "filter_by_net_name": true, 103 | "filter_by_netclass": true, 104 | "filter_text": "", 105 | "group_by_constraint": false, 106 | "group_by_netclass": false, 107 | "show_unconnected_nets": false, 108 | "show_zero_pad_nets": false, 109 | "sort_ascending": true, 110 | "sorting_column": 0 111 | }, 112 | "open_jobsets": [], 113 | "project": { 114 | "files": [] 115 | }, 116 | "schematic": { 117 | "selection_filter": { 118 | "graphics": true, 119 | "images": true, 120 | "labels": true, 121 | "lockedItems": false, 122 | "otherItems": true, 123 | "pins": true, 124 | "symbols": true, 125 | "text": true, 126 | "wires": true 127 | } 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /shields/386EX_387SX/kicad/arduino_386_387.kicad_prl: -------------------------------------------------------------------------------- 1 | { 2 | "board": { 3 | "active_layer": 0, 4 | "active_layer_preset": "", 5 | "auto_track_width": true, 6 | "hidden_netclasses": [], 7 | "hidden_nets": [], 8 | "high_contrast_mode": 0, 9 | "net_color_mode": 1, 10 | "opacity": { 11 | "images": 0.6, 12 | "pads": 1.0, 13 | "shapes": 1.0, 14 | "tracks": 1.0, 15 | "vias": 1.0, 16 | "zones": 0.6 17 | }, 18 | "ratsnest_display_mode": 0, 19 | "selection_filter": { 20 | "dimensions": true, 21 | "footprints": true, 22 | "graphics": true, 23 | "keepouts": true, 24 | "lockedItems": true, 25 | "otherItems": true, 26 | "pads": true, 27 | "text": true, 28 | "tracks": true, 29 | "vias": true, 30 | "zones": true 31 | }, 32 | "visible_items": [ 33 | "vias", 34 | "footprint_text", 35 | "footprint_anchors", 36 | "ratsnest", 37 | "grid", 38 | "footprints_front", 39 | "footprints_back", 40 | "footprint_values", 41 | "footprint_references", 42 | "tracks", 43 | "drc_errors", 44 | "drawing_sheet", 45 | "bitmaps", 46 | "pads", 47 | "zones", 48 | "drc_warnings", 49 | "shapes" 50 | ], 51 | "visible_layers": "00000000_00000000_0fffffff_ffffffff", 52 | "zone_display_mode": 0 53 | }, 54 | "git": { 55 | "repo_password": "", 56 | "repo_type": "", 57 | "repo_username": "", 58 | "ssh_key": "" 59 | }, 60 | "meta": { 61 | "filename": "arduino_386_387.kicad_prl", 62 | "version": 5 63 | }, 64 | "net_inspector_panel": { 65 | "col_hidden": [ 66 | false, 67 | false, 68 | false, 69 | false, 70 | false, 71 | false, 72 | false, 73 | false, 74 | false, 75 | false 76 | ], 77 | "col_order": [ 78 | 0, 79 | 1, 80 | 2, 81 | 3, 82 | 4, 83 | 5, 84 | 6, 85 | 7, 86 | 8, 87 | 9 88 | ], 89 | "col_widths": [ 90 | 162, 91 | 147, 92 | 91, 93 | 67, 94 | 91, 95 | 91, 96 | 91, 97 | 71, 98 | 91, 99 | 91 100 | ], 101 | "custom_group_rules": [], 102 | "expanded_rows": [], 103 | "filter_by_net_name": true, 104 | "filter_by_netclass": true, 105 | "filter_text": "", 106 | "group_by_constraint": false, 107 | "group_by_netclass": false, 108 | "show_unconnected_nets": false, 109 | "show_zero_pad_nets": false, 110 | "sort_ascending": true, 111 | "sorting_column": 0 112 | }, 113 | "open_jobsets": [], 114 | "project": { 115 | "files": [] 116 | }, 117 | "schematic": { 118 | "selection_filter": { 119 | "graphics": true, 120 | "images": true, 121 | "labels": true, 122 | "lockedItems": false, 123 | "otherItems": true, 124 | "pins": true, 125 | "symbols": true, 126 | "text": true, 127 | "wires": true 128 | } 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /shields/80186/kicad/arduino_80186.kicad_prl: -------------------------------------------------------------------------------- 1 | { 2 | "board": { 3 | "active_layer": 0, 4 | "active_layer_preset": "All Layers", 5 | "auto_track_width": true, 6 | "hidden_netclasses": [], 7 | "hidden_nets": [], 8 | "high_contrast_mode": 0, 9 | "net_color_mode": 1, 10 | "opacity": { 11 | "images": 0.6, 12 | "pads": 1.0, 13 | "shapes": 1.0, 14 | "tracks": 1.0, 15 | "vias": 1.0, 16 | "zones": 0.6 17 | }, 18 | "ratsnest_display_mode": 0, 19 | "selection_filter": { 20 | "dimensions": true, 21 | "footprints": true, 22 | "graphics": true, 23 | "keepouts": true, 24 | "lockedItems": true, 25 | "otherItems": false, 26 | "pads": true, 27 | "text": true, 28 | "tracks": true, 29 | "vias": true, 30 | "zones": true 31 | }, 32 | "visible_items": [ 33 | "vias", 34 | "footprint_text", 35 | "footprint_anchors", 36 | "ratsnest", 37 | "grid", 38 | "footprints_front", 39 | "footprints_back", 40 | "footprint_values", 41 | "footprint_references", 42 | "tracks", 43 | "drc_errors", 44 | "drawing_sheet", 45 | "bitmaps", 46 | "pads", 47 | "zones", 48 | "drc_warnings", 49 | "shapes" 50 | ], 51 | "visible_layers": "ffffffff_ffffffff_ffffffff_ffffffff", 52 | "zone_display_mode": 0 53 | }, 54 | "git": { 55 | "repo_password": "", 56 | "repo_type": "", 57 | "repo_username": "", 58 | "ssh_key": "" 59 | }, 60 | "meta": { 61 | "filename": "arduino_80186.kicad_prl", 62 | "version": 5 63 | }, 64 | "net_inspector_panel": { 65 | "col_hidden": [ 66 | false, 67 | false, 68 | false, 69 | false, 70 | false, 71 | false, 72 | false, 73 | false, 74 | false, 75 | false 76 | ], 77 | "col_order": [ 78 | 0, 79 | 1, 80 | 2, 81 | 3, 82 | 4, 83 | 5, 84 | 6, 85 | 7, 86 | 8, 87 | 9 88 | ], 89 | "col_widths": [ 90 | 162, 91 | 147, 92 | 91, 93 | 67, 94 | 91, 95 | 91, 96 | 91, 97 | 71, 98 | 91, 99 | 91 100 | ], 101 | "custom_group_rules": [], 102 | "expanded_rows": [], 103 | "filter_by_net_name": true, 104 | "filter_by_netclass": true, 105 | "filter_text": "", 106 | "group_by_constraint": false, 107 | "group_by_netclass": false, 108 | "show_unconnected_nets": false, 109 | "show_zero_pad_nets": false, 110 | "sort_ascending": true, 111 | "sorting_column": 0 112 | }, 113 | "open_jobsets": [], 114 | "project": { 115 | "files": [] 116 | }, 117 | "schematic": { 118 | "selection_filter": { 119 | "graphics": true, 120 | "images": true, 121 | "labels": true, 122 | "lockedItems": false, 123 | "otherItems": true, 124 | "pins": true, 125 | "symbols": true, 126 | "text": true, 127 | "wires": true 128 | } 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /shields/386EX_V4/kicad/arduino_386EX_V4.kicad_prl: -------------------------------------------------------------------------------- 1 | { 2 | "board": { 3 | "active_layer": 0, 4 | "active_layer_preset": "", 5 | "auto_track_width": false, 6 | "hidden_netclasses": [], 7 | "hidden_nets": [], 8 | "high_contrast_mode": 0, 9 | "net_color_mode": 1, 10 | "opacity": { 11 | "images": 0.6, 12 | "pads": 1.0, 13 | "shapes": 0.44999998807907104, 14 | "tracks": 1.0, 15 | "vias": 1.0, 16 | "zones": 0.2800000011920929 17 | }, 18 | "selection_filter": { 19 | "dimensions": true, 20 | "footprints": true, 21 | "graphics": true, 22 | "keepouts": true, 23 | "lockedItems": false, 24 | "otherItems": true, 25 | "pads": true, 26 | "text": true, 27 | "tracks": true, 28 | "vias": true, 29 | "zones": true 30 | }, 31 | "visible_items": [ 32 | "vias", 33 | "footprint_text", 34 | "footprint_anchors", 35 | "ratsnest", 36 | "grid", 37 | "footprints_front", 38 | "footprints_back", 39 | "footprint_values", 40 | "footprint_references", 41 | "tracks", 42 | "drc_errors", 43 | "drawing_sheet", 44 | "bitmaps", 45 | "pads", 46 | "zones", 47 | "drc_warnings", 48 | "conflict_shadows", 49 | "shapes" 50 | ], 51 | "visible_layers": "00000000_00000000_0fffffff_ffffffff", 52 | "zone_display_mode": 0 53 | }, 54 | "git": { 55 | "repo_password": "", 56 | "repo_type": "", 57 | "repo_username": "", 58 | "ssh_key": "" 59 | }, 60 | "meta": { 61 | "filename": "arduino_386EX_V4.kicad_prl", 62 | "version": 5 63 | }, 64 | "net_inspector_panel": { 65 | "col_hidden": [ 66 | false, 67 | false, 68 | false, 69 | false, 70 | false, 71 | false, 72 | false, 73 | false, 74 | false, 75 | false 76 | ], 77 | "col_order": [ 78 | 0, 79 | 1, 80 | 2, 81 | 3, 82 | 4, 83 | 5, 84 | 6, 85 | 7, 86 | 8, 87 | 9 88 | ], 89 | "col_widths": [ 90 | 162, 91 | 147, 92 | 91, 93 | 67, 94 | 91, 95 | 91, 96 | 91, 97 | 71, 98 | 91, 99 | 91 100 | ], 101 | "custom_group_rules": [], 102 | "expanded_rows": [], 103 | "filter_by_net_name": true, 104 | "filter_by_netclass": true, 105 | "filter_text": "", 106 | "group_by_constraint": false, 107 | "group_by_netclass": false, 108 | "show_unconnected_nets": false, 109 | "show_zero_pad_nets": false, 110 | "sort_ascending": true, 111 | "sorting_column": 0 112 | }, 113 | "open_jobsets": [], 114 | "project": { 115 | "files": [] 116 | }, 117 | "schematic": { 118 | "selection_filter": { 119 | "graphics": true, 120 | "images": true, 121 | "labels": true, 122 | "lockedItems": false, 123 | "otherItems": true, 124 | "pins": true, 125 | "symbols": true, 126 | "text": true, 127 | "wires": true 128 | } 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /shields/808x/gerbers/ard8088-NPTH-drl_map.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,(6.0.7)*% 2 | %TF.CreationDate,2024-05-09T09:54:02-04:00*% 3 | %TF.ProjectId,ard8088,61726438-3038-4382-9e6b-696361645f70,1.1*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Drillmap*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX45Y45*% 8 | G04 Gerber Fmt 4.5, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW (6.0.7)) date 2024-05-09 09:54:02* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10C,0.100000*% 15 | %ADD11C,0.200000*% 16 | G04 APERTURE END LIST* 17 | D10* 18 | X19177000Y-11811000D02* 19 | X9553546Y-11811000D01* 20 | X9553546Y-6223000D01* 21 | X19177000Y-6223000D01* 22 | X19177000Y-11811000D01* 23 | D11* 24 | X9806165Y-12126476D02* 25 | X9806165Y-11926476D01* 26 | X9853784Y-11926476D01* 27 | X9882355Y-11936000D01* 28 | X9901403Y-11955048D01* 29 | X9910927Y-11974095D01* 30 | X9920450Y-12012190D01* 31 | X9920450Y-12040762D01* 32 | X9910927Y-12078857D01* 33 | X9901403Y-12097905D01* 34 | X9882355Y-12116952D01* 35 | X9853784Y-12126476D01* 36 | X9806165Y-12126476D01* 37 | X10006165Y-12126476D02* 38 | X10006165Y-11993143D01* 39 | X10006165Y-12031238D02* 40 | X10015688Y-12012190D01* 41 | X10025212Y-12002667D01* 42 | X10044260Y-11993143D01* 43 | X10063308Y-11993143D01* 44 | X10129974Y-12126476D02* 45 | X10129974Y-11993143D01* 46 | X10129974Y-11926476D02* 47 | X10120450Y-11936000D01* 48 | X10129974Y-11945524D01* 49 | X10139498Y-11936000D01* 50 | X10129974Y-11926476D01* 51 | X10129974Y-11945524D01* 52 | X10253784Y-12126476D02* 53 | X10234736Y-12116952D01* 54 | X10225212Y-12097905D01* 55 | X10225212Y-11926476D01* 56 | X10358546Y-12126476D02* 57 | X10339498Y-12116952D01* 58 | X10329974Y-12097905D01* 59 | X10329974Y-11926476D01* 60 | X10587117Y-12126476D02* 61 | X10587117Y-11926476D01* 62 | X10653784Y-12069333D01* 63 | X10720450Y-11926476D01* 64 | X10720450Y-12126476D01* 65 | X10901403Y-12126476D02* 66 | X10901403Y-12021714D01* 67 | X10891879Y-12002667D01* 68 | X10872831Y-11993143D01* 69 | X10834736Y-11993143D01* 70 | X10815688Y-12002667D01* 71 | X10901403Y-12116952D02* 72 | X10882355Y-12126476D01* 73 | X10834736Y-12126476D01* 74 | X10815688Y-12116952D01* 75 | X10806165Y-12097905D01* 76 | X10806165Y-12078857D01* 77 | X10815688Y-12059809D01* 78 | X10834736Y-12050286D01* 79 | X10882355Y-12050286D01* 80 | X10901403Y-12040762D01* 81 | X10996641Y-11993143D02* 82 | X10996641Y-12193143D01* 83 | X10996641Y-12002667D02* 84 | X11015688Y-11993143D01* 85 | X11053784Y-11993143D01* 86 | X11072831Y-12002667D01* 87 | X11082355Y-12012190D01* 88 | X11091879Y-12031238D01* 89 | X11091879Y-12088381D01* 90 | X11082355Y-12107428D01* 91 | X11072831Y-12116952D01* 92 | X11053784Y-12126476D01* 93 | X11015688Y-12126476D01* 94 | X10996641Y-12116952D01* 95 | X11177593Y-12107428D02* 96 | X11187117Y-12116952D01* 97 | X11177593Y-12126476D01* 98 | X11168069Y-12116952D01* 99 | X11177593Y-12107428D01* 100 | X11177593Y-12126476D01* 101 | X11177593Y-12002667D02* 102 | X11187117Y-12012190D01* 103 | X11177593Y-12021714D01* 104 | X11168069Y-12012190D01* 105 | X11177593Y-12002667D01* 106 | X11177593Y-12021714D01* 107 | M02* 108 | -------------------------------------------------------------------------------- /shields/808x/gerbers/ard8088-job.gbrjob: -------------------------------------------------------------------------------- 1 | { 2 | "Header": { 3 | "GenerationSoftware": { 4 | "Vendor": "KiCad", 5 | "Application": "Pcbnew", 6 | "Version": "(6.0.7)" 7 | }, 8 | "CreationDate": "2024-05-09T09:52:52-04:00" 9 | }, 10 | "GeneralSpecs": { 11 | "ProjectId": { 12 | "Name": "ard8088", 13 | "GUID": "61726438-3038-4382-9e6b-696361645f70", 14 | "Revision": "1.1" 15 | }, 16 | "Size": { 17 | "X": 96.3345, 18 | "Y": 55.98 19 | }, 20 | "LayerNumber": 2, 21 | "BoardThickness": 1.6, 22 | "Finish": "None" 23 | }, 24 | "DesignRules": [ 25 | { 26 | "Layers": "Outer", 27 | "PadToPad": 0.2, 28 | "PadToTrack": 0.2, 29 | "TrackToTrack": 0.2, 30 | "MinLineWidth": 0.25, 31 | "TrackToRegion": 0.508, 32 | "RegionToRegion": 0.508 33 | } 34 | ], 35 | "FilesAttributes": [ 36 | { 37 | "Path": "ard8088-F_Cu.gtl", 38 | "FileFunction": "Copper,L1,Top", 39 | "FilePolarity": "Positive" 40 | }, 41 | { 42 | "Path": "ard8088-B_Cu.gbl", 43 | "FileFunction": "Copper,L2,Bot", 44 | "FilePolarity": "Positive" 45 | }, 46 | { 47 | "Path": "ard8088-F_Paste.gtp", 48 | "FileFunction": "SolderPaste,Top", 49 | "FilePolarity": "Positive" 50 | }, 51 | { 52 | "Path": "ard8088-B_Paste.gbp", 53 | "FileFunction": "SolderPaste,Bot", 54 | "FilePolarity": "Positive" 55 | }, 56 | { 57 | "Path": "ard8088-F_Silkscreen.gto", 58 | "FileFunction": "Legend,Top", 59 | "FilePolarity": "Positive" 60 | }, 61 | { 62 | "Path": "ard8088-B_Silkscreen.gbo", 63 | "FileFunction": "Legend,Bot", 64 | "FilePolarity": "Positive" 65 | }, 66 | { 67 | "Path": "ard8088-F_Mask.gts", 68 | "FileFunction": "SolderMask,Top", 69 | "FilePolarity": "Negative" 70 | }, 71 | { 72 | "Path": "ard8088-B_Mask.gbs", 73 | "FileFunction": "SolderMask,Bot", 74 | "FilePolarity": "Negative" 75 | }, 76 | { 77 | "Path": "ard8088-Edge_Cuts.gm1", 78 | "FileFunction": "Profile", 79 | "FilePolarity": "Positive" 80 | } 81 | ], 82 | "MaterialStackup": [ 83 | { 84 | "Type": "Legend", 85 | "Name": "Top Silk Screen" 86 | }, 87 | { 88 | "Type": "SolderPaste", 89 | "Name": "Top Solder Paste" 90 | }, 91 | { 92 | "Type": "SolderMask", 93 | "Name": "Top Solder Mask" 94 | }, 95 | { 96 | "Type": "Copper", 97 | "Name": "F.Cu" 98 | }, 99 | { 100 | "Type": "Dielectric", 101 | "Material": "FR4", 102 | "Name": "F.Cu/B.Cu", 103 | "Notes": "Type: dielectric layer 1 (from F.Cu to B.Cu)" 104 | }, 105 | { 106 | "Type": "Copper", 107 | "Name": "B.Cu" 108 | }, 109 | { 110 | "Type": "SolderMask", 111 | "Name": "Bottom Solder Mask" 112 | }, 113 | { 114 | "Type": "SolderPaste", 115 | "Name": "Bottom Solder Paste" 116 | }, 117 | { 118 | "Type": "Legend", 119 | "Name": "Bottom Silk Screen" 120 | } 121 | ] 122 | } 123 | -------------------------------------------------------------------------------- /shields/387SX_V2/kicad/arduino_387SX_V2.kicad_prl: -------------------------------------------------------------------------------- 1 | { 2 | "board": { 3 | "active_layer": 5, 4 | "active_layer_preset": "", 5 | "auto_track_width": true, 6 | "hidden_netclasses": [], 7 | "hidden_nets": [], 8 | "high_contrast_mode": 0, 9 | "net_color_mode": 1, 10 | "opacity": { 11 | "images": 0.6, 12 | "pads": 1.0, 13 | "shapes": 1.0, 14 | "tracks": 1.0, 15 | "vias": 1.0, 16 | "zones": 0.6 17 | }, 18 | "ratsnest_display_mode": 0, 19 | "selection_filter": { 20 | "dimensions": true, 21 | "footprints": true, 22 | "graphics": true, 23 | "keepouts": true, 24 | "lockedItems": true, 25 | "otherItems": true, 26 | "pads": true, 27 | "text": true, 28 | "tracks": true, 29 | "vias": true, 30 | "zones": true 31 | }, 32 | "visible_items": [ 33 | "vias", 34 | "footprint_text", 35 | "footprint_anchors", 36 | "ratsnest", 37 | "grid", 38 | "footprints_front", 39 | "footprints_back", 40 | "footprint_values", 41 | "footprint_references", 42 | "tracks", 43 | "drc_errors", 44 | "drawing_sheet", 45 | "bitmaps", 46 | "pads", 47 | "zones", 48 | "drc_warnings", 49 | "shapes" 50 | ], 51 | "visible_layers": "00000000_00000000_0fffffff_ffffffff", 52 | "zone_display_mode": 0 53 | }, 54 | "git": { 55 | "repo_password": "", 56 | "repo_type": "", 57 | "repo_username": "", 58 | "ssh_key": "" 59 | }, 60 | "meta": { 61 | "filename": "arduino_387SX_V2.kicad_prl", 62 | "version": 5 63 | }, 64 | "net_inspector_panel": { 65 | "col_hidden": [ 66 | false, 67 | false, 68 | false, 69 | false, 70 | false, 71 | false, 72 | false, 73 | false, 74 | false, 75 | false, 76 | false, 77 | false 78 | ], 79 | "col_order": [ 80 | 0, 81 | 1, 82 | 2, 83 | 3, 84 | 4, 85 | 5, 86 | 6, 87 | 7, 88 | 8, 89 | 9, 90 | 10, 91 | 11 92 | ], 93 | "col_widths": [ 94 | 162, 95 | 147, 96 | 91, 97 | 67, 98 | 91, 99 | 91, 100 | 91, 101 | 71, 102 | 91, 103 | 91, 104 | 91, 105 | 91 106 | ], 107 | "custom_group_rules": [], 108 | "expanded_rows": [], 109 | "filter_by_net_name": true, 110 | "filter_by_netclass": true, 111 | "filter_text": "", 112 | "group_by_constraint": false, 113 | "group_by_netclass": false, 114 | "show_unconnected_nets": false, 115 | "show_zero_pad_nets": false, 116 | "sort_ascending": true, 117 | "sorting_column": 0 118 | }, 119 | "open_jobsets": [], 120 | "project": { 121 | "files": [] 122 | }, 123 | "schematic": { 124 | "selection_filter": { 125 | "graphics": true, 126 | "images": true, 127 | "labels": true, 128 | "lockedItems": false, 129 | "otherItems": true, 130 | "pins": true, 131 | "symbols": true, 132 | "text": true, 133 | "wires": true 134 | } 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /crates/arduinox86_egui/src/resource_manager.rs: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | use crate::{structs::BinaryBlob, windows::BinaryView}; 24 | 25 | use anyhow::Result; 26 | 27 | #[derive(Default)] 28 | pub struct ResourceManager { 29 | blobs: Vec, 30 | } 31 | 32 | impl ResourceManager { 33 | pub fn blob_exists(&self, blob_name: &str) -> bool { 34 | self.blobs.iter().any(|b| b.name == blob_name) 35 | } 36 | 37 | pub fn add_blob(&mut self, blob: BinaryBlob) -> Result { 38 | if self.blob_exists(&blob.name) { 39 | return Err(anyhow::anyhow!("Blob with name '{}' already exists.", blob.name)); 40 | } 41 | self.blobs.push(blob.clone()); 42 | let mut view = BinaryView::new(&blob.name); 43 | view.set_data(&blob.data); 44 | Ok(view) 45 | } 46 | 47 | pub fn update_blob(&mut self, blob_name: &str, new_data: &[u8]) -> Result<()> { 48 | if !self.blob_exists(blob_name) { 49 | return Err(anyhow::anyhow!("Blob with name '{}' does not exist.", blob_name)); 50 | } 51 | if let Some(blob) = self.blobs.iter_mut().find(|b| b.name == blob_name) { 52 | blob.data = new_data.to_vec(); 53 | } 54 | Ok(()) 55 | } 56 | 57 | pub fn remove_blob(&mut self, blob_name: &str) -> Result<()> { 58 | if !self.blob_exists(blob_name) { 59 | return Err(anyhow::anyhow!("Blob with name '{}' does not exist.", blob_name)); 60 | } 61 | if let Some(index) = self.blobs.iter().position(|b| b.name == blob_name) { 62 | self.blobs.remove(index); 63 | } 64 | Ok(()) 65 | } 66 | 67 | pub fn blob(&self, blob_name: &str) -> Option<&BinaryBlob> { 68 | self.blobs.iter().find(|b| b.name == blob_name) 69 | } 70 | 71 | pub fn blob_mut(&mut self, blob_name: &str) -> Option<&mut BinaryBlob> { 72 | self.blobs.iter_mut().find(|b| b.name == blob_name) 73 | } 74 | 75 | pub fn blobs(&self) -> &[BinaryBlob] { 76 | &self.blobs 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /crates/arduinox86_egui/src/scheduler.rs: -------------------------------------------------------------------------------- 1 | /* 2 | ArduinoX86 Copyright 2022-2025 Daniel Balsom 3 | https://github.com/dbalsom/arduinoX86 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the “Software”), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | use std::{collections::LinkedList, time::Instant}; 25 | 26 | use crate::{ 27 | events::{GuiEvent, GuiEventQueue}, 28 | structs::ScheduledEvent, 29 | }; 30 | 31 | pub struct Scheduler { 32 | last_run: Instant, 33 | events: LinkedList, 34 | } 35 | 36 | impl Default for Scheduler { 37 | fn default() -> Self { 38 | Self::new() 39 | } 40 | } 41 | 42 | impl Scheduler { 43 | pub fn new() -> Self { 44 | Self { 45 | last_run: Instant::now(), 46 | events: LinkedList::new(), 47 | } 48 | } 49 | 50 | pub fn add_event(&mut self, event: ScheduledEvent) { 51 | self.events.push_back(event); 52 | } 53 | 54 | pub fn clear_events(&mut self) { 55 | self.events.clear(); 56 | } 57 | 58 | pub fn remove_event_type(&mut self, event_type: &GuiEvent) { 59 | self.events.extract_if(|e| e.event == *event_type).for_each(drop); 60 | } 61 | 62 | pub fn replace_event_type(&mut self, event: ScheduledEvent) { 63 | self.remove_event_type(&event.event); 64 | self.add_event(event); 65 | } 66 | 67 | pub fn run(&mut self, events: &mut GuiEventQueue) { 68 | let elapsed = self.last_run.elapsed(); 69 | self.last_run = Instant::now(); 70 | 71 | let duration_millis = elapsed.as_millis() as u64; 72 | 73 | for event in self.events.iter_mut() { 74 | event.ms_accum += duration_millis; 75 | 76 | if event.ms_accum >= event.time { 77 | event.ms_accum -= event.time; 78 | 79 | match event.event { 80 | GuiEvent::PollStatus => { 81 | events.push(GuiEvent::PollStatus); 82 | } 83 | GuiEvent::RefreshMemory => { 84 | events.push(GuiEvent::RefreshMemory); 85 | } 86 | _ => {} 87 | } 88 | } 89 | } 90 | } 91 | } 92 | --------------------------------------------------------------------------------