Today two boot projects. One using a bios extension, so it chip based. Second is a floppy disk boot program. (Creating a test situation to get our old Boot floppy demo working. ( That one without using an operatingsystem like ms-dos.
Creating a Secondary Bios ROM
NAME mycode
.model small
ORG 0h
.code
dw 0AA55h ; Magic header your bios is looking for
db 16 ; lenght of this rom in 512 bytes == 8k
jmp short clear ; jmp to program
ORG 20h ; start of program
clear: mov cx,10 ; clear, set keyboard led and print 10 # chars
mov ah,0ah
mov al,31h
int 10h
mov bh,0
mov cx,1
start: mov al, 11000000b
out 80h, al
print: mov cx,10
mov ah,0ah
mov al,"#"
int 10h
loop1: nop ; loop until doomsday
jmp loop1
db -68 ; This makes the checksum 0
; steps to take: edit source, make this byte entry 0
; compile using make.bat in dosbox
; check checksum using my python script
; output was 68 hex 0x44
; edit asm file place -68 to make the checksum 0x00 again
; compile and burn to ROM
ORG 2000h ; create end of rom 0000h-1fffh = 8K
END
make.bat in dosbox
@ECHO OFF
MASM /DARCH_TYPE="T" /DCPU_TYPE="V" 1;
LINK 1;
EXE2COM 1.EXE
My BBC Acorn model B is working again. The original monitor is still dead.
Time to play with some machine code and ROMs.
My machine has a NFS rom installed. (NetFS)
Econet was Acorn Computers’s low-cost local area network system, intended for use by schools and small businesses. It was widely used in those areas, and was supported by a large number of different computer and server systems produced both by Acorn and by other companies.
I found a ROM online called Gremlin. It is a 16K rom file. But at the moment I only got some 28C64 (8k) or 28C256 (32k) eeproms.
32k it is. But de beeb having address line A14 floating high, I need to flash the upper 16k of the 32k ROM.
Ben posted a youtube about Wozmon running on his 6502.
In 1976, Steve Wozniac wrote what’s commonly known simply as Wozmon.
Wozmon is a machine-code monitor program written by Wozniak for the Apple 1. In Only 256 bytes ! Being pure 6502 code easily adaptable. A monitor program allows you to view/edit and run machine code using simple commands.
I’ve got a different setup as Ben’s computer. But changing the necessary, and it will run on my 6502.
I’m not using rs232 voltage levels (-7 till -25 and +7 till +25 volts). I’m using a usb serial uart standard 5v leveling stick …
For address decoder see other post
Simplified schematic of my UART/ACIA
Compiling the Wosmon gave me an error, DEC is not a valid opcode for a bare 6502 .. but we have a 65c02. Solution: Add -c02 extra opcodes
error 1 in line 187 of "wozmon.s": illegal operand types
> DEC ; Decrement A.
# fix .. add -c02
vasm6502_oldstyle -c02 -Fbin -dotdir wozmon.s
Below Apple I Manual with the sourcecode for Wozmon
Uploading didn’t work Solution: Using chrome it had access to the usb port to upload, firefox didn’t work
The program didn’t compile, faulty or zero size hex file. Solution: Wrong Maqueen library was in the examples (After changing, needed version update also, see below)
Not everything is in Dutch (I like English, but this is for the boy), maqueen V2 needed a lot of translation. (So we joined https://crowdin.com/project/makecode/nl to help translating the libraries)
Apparently my AI camera can be connected to this robot!
I wrote a little python script which checks the checksum of a Bios.
In a previous post i used hexedit to play around changing a Bios dump.
Below posted python script calculates the checkum using the following:
Add all bytes in the file and do a modulo 256 on this number. The output should be 0.
My previous edit gave me a output of C2, so I changed an unused byte FF into (FF-C2) 3D. No more checksum errors when booting!
Next to do, get a Bios like Glabios or PcXtBios to start my own code from a secondary Eeprom.
import sys
# Bios sum modulo should be 0
# edit last or unused byte to fix
# python bios-checksum-test.py MYROM.edit.checksum
# 0
f = open(sys.argv[1],'rb')
m = f.read()
print '%x' % ( ( sum(ord(c) for c in m) & 0xFFFFFFFF ) % 256 )
Python3
import sys
# Bios sum modulo should be 0
# edit last or unused byte to fix
# python bios-checksum-test.py MYROM.edit.checksum
# 0
f = open(sys.argv[1],'rb')
m = f.read()
checksum = ( ( sum((c) for c in m) & 0xFFFFFFFF ) % 256 )
print(checksum, 'in hex =', hex(checksum))