Fixed 86Box stack issues
This commit is contained in:
parent
a29c6940d5
commit
4b581d497d
10 changed files with 1274 additions and 1243 deletions
BIN
doc/assets/86box-machine.png
Normal file
BIN
doc/assets/86box-machine.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 46 KiB |
BIN
doc/assets/86box-video.png
Normal file
BIN
doc/assets/86box-video.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
BIN
doc/assets/Capture-86Box.png
Normal file
BIN
doc/assets/Capture-86Box.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
BIN
doc/assets/Capture-QEMU.png
Normal file
BIN
doc/assets/Capture-QEMU.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
12
doc/assets/screenshot.md
Normal file
12
doc/assets/screenshot.md
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Screenshot of early boot version + Text functions
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Screenshot of early buttons & sliders
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Screenshot of rounded buttons & checkboxes
|
||||||
65
doc/build.md
Normal file
65
doc/build.md
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
### Build & Run
|
||||||
|
|
||||||
|
#### Compilation
|
||||||
|
|
||||||
|
From the project root:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd src
|
||||||
|
nasm -f bin boot.asm -o ..\build\bios.bin
|
||||||
|
```
|
||||||
|
|
||||||
|
This produces a raw BIOS ROM image (bios.bin) suitable for direct execution by QEMU.
|
||||||
|
|
||||||
|
#### QEMU Execution
|
||||||
|
|
||||||
|
The QEMU VGA BIOS must be copied into a local rom/ directory.
|
||||||
|
|
||||||
|
Default locations of `vgabios.bin`:
|
||||||
|
|
||||||
|
Windows
|
||||||
|
`C:\Program Files\qemu\share\vgabios.bin`
|
||||||
|
|
||||||
|
Linux
|
||||||
|
`/usr/share/qemu/vgabios.bin`
|
||||||
|
|
||||||
|
You can use an video bios from the 86box's project:
|
||||||
|
|
||||||
|
https://github.com/86Box/roms
|
||||||
|
|
||||||
|
Copy it to: `roms/vgabios.bin`
|
||||||
|
|
||||||
|
Then run QEMU with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
qemu-system-i386 \
|
||||||
|
-bios build/bios.bin \
|
||||||
|
-device loader,file=roms/vgabios.bin,addr=0xC0000,force-raw=on \
|
||||||
|
-device isa-debugcon,chardev=myconsole \
|
||||||
|
-chardev stdio,id=myconsole \
|
||||||
|
-k be \
|
||||||
|
-display sdl
|
||||||
|
```
|
||||||
|
|
||||||
|
This command:
|
||||||
|
|
||||||
|
- Loads the custom BIOS as the system ROM
|
||||||
|
- Injects the VGA BIOS at 0xC0000
|
||||||
|
- Redirects debug output to the console
|
||||||
|
- Displays graphics using SDL
|
||||||
|
|
||||||
|
#### 86Box Execution
|
||||||
|
|
||||||
|
This is a bit tricky since 86box doesn't allow to pick custom BIOS file. You'll have to choose an existing computer and replace the original BIOS file with the compliled one.
|
||||||
|
|
||||||
|
create a new configuration:
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- save the configuration
|
||||||
|
- go to the 86Box's `roms\machines\vli486sv2g\` folder
|
||||||
|
- rename the `0402.001` file (it's the original machine's BIOS);
|
||||||
|
- copy the `build\bios.bin` into the 86Bos's `roms\machines\vli486sv2g\` folder and rename as `0402.001`
|
||||||
|
|
||||||
|
|
||||||
74
readme.md
74
readme.md
|
|
@ -12,17 +12,9 @@ Rather than booting an operating system from disk, the PC starts **directly from
|
||||||
|
|
||||||
The project is intentionally educational, experimental, and minimalist.
|
The project is intentionally educational, experimental, and minimalist.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Screenshot of early boot version + Text functions
|
You may want to get a look at the [Older screenshots](/doc/assets/screenshot.md)
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Screenshot of early buttons & sliders
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Screenshot of rounded buttons & checkboxes
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
@ -82,53 +74,7 @@ Get a look at the [API](/doc/API.md) for more information.
|
||||||
|
|
||||||
### Build and Run
|
### Build and Run
|
||||||
|
|
||||||
#### Compilation
|
[read detailed step to compile an run](/doc/build.md)
|
||||||
|
|
||||||
From the project root:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd src
|
|
||||||
nasm -f bin boot.asm -o ..\build\bios.bin
|
|
||||||
```
|
|
||||||
|
|
||||||
This produces a raw BIOS ROM image (bios.bin) suitable for direct execution by QEMU.
|
|
||||||
|
|
||||||
#### Execution
|
|
||||||
|
|
||||||
The QEMU VGA BIOS must be copied into a local rom/ directory.
|
|
||||||
|
|
||||||
Default locations of `vgabios.bin`:
|
|
||||||
|
|
||||||
Windows
|
|
||||||
`C:\Program Files\qemu\share\vgabios.bin`
|
|
||||||
|
|
||||||
Linux
|
|
||||||
`/usr/share/qemu/vgabios.bin`
|
|
||||||
|
|
||||||
You can use an video bios from the 86box's project:
|
|
||||||
|
|
||||||
https://github.com/86Box/roms
|
|
||||||
|
|
||||||
Copy it to: `roms/vgabios.bin`
|
|
||||||
|
|
||||||
Then run QEMU with:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
qemu-system-i386 \
|
|
||||||
-bios build/bios.bin \
|
|
||||||
-device loader,file=roms/vgabios.bin,addr=0xC0000,force-raw=on \
|
|
||||||
-device isa-debugcon,chardev=myconsole \
|
|
||||||
-chardev stdio,id=myconsole \
|
|
||||||
-k be \
|
|
||||||
-display sdl
|
|
||||||
```
|
|
||||||
|
|
||||||
This command:
|
|
||||||
|
|
||||||
- Loads the custom BIOS as the system ROM
|
|
||||||
- Injects the VGA BIOS at 0xC0000
|
|
||||||
- Redirects debug output to the console
|
|
||||||
- Displays graphics using SDL
|
|
||||||
|
|
||||||
### Non-Goals
|
### Non-Goals
|
||||||
|
|
||||||
|
|
@ -149,20 +95,6 @@ Ce projet consiste à concevoir et développer un **BIOS/ROM PC compatible enti
|
||||||
|
|
||||||
Au lieu de charger un système d’exploitation depuis un disque, le PC **démarre directement depuis la ROM** vers une **interface graphique minimaliste**, utilisant le mode **CGA Haute Résolution Monochrome (640×200)**.
|
Au lieu de charger un système d’exploitation depuis un disque, le PC **démarre directement depuis la ROM** vers une **interface graphique minimaliste**, utilisant le mode **CGA Haute Résolution Monochrome (640×200)**.
|
||||||
|
|
||||||
Le projet est volontairement **éducatif, expérimental et minimaliste**.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Screenshot of early boot version + Text functions
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Screenshot of early buttons & sliders
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Screenshot of rounded buttons & checkboxes
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Objectifs
|
### Objectifs
|
||||||
|
|
|
||||||
|
|
@ -152,14 +152,14 @@ main_loop:
|
||||||
pop ds
|
pop ds
|
||||||
|
|
||||||
DEBUG 1
|
DEBUG 1
|
||||||
ISADBG ISA_RED, 1
|
ISADBG ISA_LEFT, 1
|
||||||
|
|
||||||
; Init du système GUI
|
; Init du système GUI
|
||||||
call gui_init_system
|
call gui_init_system
|
||||||
|
|
||||||
|
|
||||||
DEBUG 2
|
DEBUG 2
|
||||||
ISADBG ISA_RED, 2
|
ISADBG ISA_LEFT, 2
|
||||||
|
|
||||||
; --- CRÉATION DYNAMIQUE DES BOUTONS ---
|
; --- CRÉATION DYNAMIQUE DES BOUTONS ---
|
||||||
|
|
||||||
|
|
@ -180,7 +180,7 @@ main_loop:
|
||||||
GUI OBJ_SET_TEXT, ax, cs, str_option3
|
GUI OBJ_SET_TEXT, ax, cs, str_option3
|
||||||
|
|
||||||
DEBUG 3
|
DEBUG 3
|
||||||
ISADBG ISA_RED, 3
|
ISADBG ISA_LEFT, 3
|
||||||
|
|
||||||
; Créer Slider (Drag)
|
; Créer Slider (Drag)
|
||||||
GUI OBJ_CREATE, OBJ_TYPE_SLIDER, 10, 100, 150, 12
|
GUI OBJ_CREATE, OBJ_TYPE_SLIDER, 10, 100, 150, 12
|
||||||
|
|
@ -197,7 +197,7 @@ main_loop:
|
||||||
mov .value, 0xFADE
|
mov .value, 0xFADE
|
||||||
|
|
||||||
DEBUG 4
|
DEBUG 4
|
||||||
ISADBG ISA_RED, 4
|
ISADBG ISA_LEFT, 4
|
||||||
|
|
||||||
.loop:
|
.loop:
|
||||||
call gui_process_all
|
call gui_process_all
|
||||||
|
|
|
||||||
|
|
@ -20,45 +20,59 @@
|
||||||
;
|
;
|
||||||
; =============================================================================
|
; =============================================================================
|
||||||
|
|
||||||
%macro DEBUG 1
|
%define DISABLE_DEBUGER
|
||||||
GFX GOTOXY, 0, 0
|
|
||||||
mov ax, %1
|
|
||||||
call print_word_hex
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
;
|
%ifndef DISABLE_DEBUGER
|
||||||
; Debugger for 86Box
|
|
||||||
;
|
|
||||||
%define ISA_DBG_PORT 0x007a
|
|
||||||
;
|
|
||||||
%define ISA_RED 0
|
|
||||||
%define ISA_GREEN 1
|
|
||||||
%define ISA_RIGHT 2
|
|
||||||
%define ISA_LEFT 3
|
|
||||||
%define ISA_RESET 0xff
|
|
||||||
|
|
||||||
%macro ISADBG 2
|
%macro DEBUG 1
|
||||||
push dx
|
GFX GOTOXY, 0, 0
|
||||||
push ax
|
mov ax, %1
|
||||||
mov dx, ISA_DBG_PORT
|
call print_word_hex
|
||||||
mov al, byte %1
|
%endmacro
|
||||||
out dx, al
|
|
||||||
inc dx
|
|
||||||
mov al, byte %2
|
|
||||||
out dx, al
|
|
||||||
pop ax
|
|
||||||
pop dx
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
%macro ISADBG_RESET 0
|
;
|
||||||
push dx
|
; Debugger for 86Box
|
||||||
push ax
|
;
|
||||||
mov dx, ISA_DBG_PORT
|
%define ISA_DBG_PORT 0x007a
|
||||||
mov al, ISA_RESET
|
;
|
||||||
out dx, al
|
%define ISA_RED 0
|
||||||
pop ax
|
%define ISA_GREEN 1
|
||||||
pop dx
|
%define ISA_RIGHT 2
|
||||||
%endmacro
|
%define ISA_LEFT 3
|
||||||
|
%define ISA_RESET 0xff
|
||||||
|
|
||||||
|
%macro ISADBG 2
|
||||||
|
push dx
|
||||||
|
push ax
|
||||||
|
mov dx, ISA_DBG_PORT
|
||||||
|
mov al, byte %1
|
||||||
|
out dx, al
|
||||||
|
inc dx
|
||||||
|
mov al, byte %2
|
||||||
|
out dx, al
|
||||||
|
pop ax
|
||||||
|
pop dx
|
||||||
|
%endmacro
|
||||||
|
|
||||||
|
%macro ISADBG_RESET 0
|
||||||
|
push dx
|
||||||
|
push ax
|
||||||
|
mov dx, ISA_DBG_PORT
|
||||||
|
mov al, ISA_RESET
|
||||||
|
out dx, al
|
||||||
|
pop ax
|
||||||
|
pop dx
|
||||||
|
%endmacro
|
||||||
|
%else
|
||||||
|
%macro DEBUG 1
|
||||||
|
%endmacro
|
||||||
|
|
||||||
|
%macro ISADBG 2
|
||||||
|
%endmacro
|
||||||
|
|
||||||
|
%macro ISADBG_RESET 0
|
||||||
|
%endmacro
|
||||||
|
%endif
|
||||||
|
|
||||||
; -----------------------------------------------------------------------------------
|
; -----------------------------------------------------------------------------------
|
||||||
; PC components I/O ports
|
; PC components I/O ports
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue