thanks for the interrupt code. I expect that the weirdness with MP/M is
the chip select code for controlling the interrupts either. Could you
Ian.
Post by James MoxhamHi Ian,
I'm not sure what versions are out there, but the interrupt code is below,
and then there are some changes in the chip select part of Grant's code to
add some ports so you can turn the interrupts on and off. So if this isn't
in your library let me know. To run MP/M you will also need the MMU as well
to use all the memory on the 512k chip.
Cheers, James
-- Interrupt controller - uses a standard Q flip flop
-- turn interrupts on and off with a write to a port
-- allows bootup with no interrupts running, then enable once interrupt
code is set up
-- by James Moxham 2014 for Grant Searle's minicomputer
--library declarations - need all these to do simple maths and logic
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use IEEE.STD_LOGIC_ARITH.all;
use IEEE.STD_LOGIC_UNSIGNED.all;
--This is a D Flip-Flop with Synchronous Reset,Set and Clock
Enable(posedge clk).
--Note that the reset input has the highest priority,Set being the next
highest
--priority and clock enable having the lowest priority.
entity interrupt is
port(
Q : out std_logic; -- Flip flop Data output
CLK :in std_logic; -- Clock input
CE :in std_logic; -- Clock enable input
RESET :in std_logic; -- Synchronous reset input
D :in std_logic; -- Data input
SET : in std_logic; -- Synchronous set input
InterruptGen : out std_logic -- triggers if Q is 1 and reached the clock
count
);
end interrupt;
architecture rtl of interrupt is --architecture of the circuit.
signal interruptClkCount : std_logic_vector(25 downto 0); -- 25 bits for
counts to 25 million
signal Qlocal : std_logic;
begin --"begin" statement for architecture.
process(CLK) --process with sensitivity list.
begin --"begin" statment for the process.
if ( rising_edge(CLK) ) then --This makes the process synchronous(with
clock)
if (RESET = '1') then
Q <= '0';
else
if(SET = '1') then
Q <= '1';
Qlocal <= '0';
else
if ( CE = '1') then
Q <= D;
Qlocal <= D;
end if;
end if;
end if;
end if;
end process; --end of process statement.
process(CLK) -- create interrupt 50x a second
begin
if rising_edge(CLK) then
-- 25,000,000 is 2x a second 5,000,000 is 10x a second, 1,000,000 is 50x a
second
if interruptClkCount < 1000000 then
interruptClkCount <= interruptClkCount+1;
else
interruptClkCount <= (others =>'0');
end if;
-- set time the interrupt is low
if (interruptClkCount < 23) and (Qlocal = '1') then -- some instructions
need up to 23 cycles http://www.z80.info/interrup.htm
interruptGen <= '0';
else
interruptGen <= '1';
end if;
end if;
end process;
end rtl;
Hi Max and FPGA Multicomp users,
Many thanks for providing your ROM-MJS Max. I use Linux and I wasn't
looking forward to either trying to get Grant's Windows download software
working using Wine or writing my own equivalent. Your code makes getting a
working system much quicker and easier! Note that I am using your V0.1 code.
In the installation instructions it says that an interrupt controller is
required for MP/M. I have used the Microcomputer.zip and Components.zip
from here
http://n8vem-sbc.pbworks.com/w/browse/#view=ViewFolder¶m=VHDL%20code
but I cannot see an interrupt controller in this code. Is the interrupt
controller somewhere else or are there newer versions of Microcomputer.zip
and Components.zip somewhere else?
To copy Max's disk image to an SDcard I used a PC without a hard disk
(just in case I made any mistakes with dd) and booted Puppy Linux from a
CD. I then used dd to copy the image from a USB stick to the 2GB SDcard. To
reformat the FAT32 partition I tried to use GParted but it maintained that
there was no partition table on the SDcard. I then read the Wikipedia page
on MBRs and loaded Max's disk image into a binary editor and looked at the
partition entries. The documentation says that the partitions are 8 MB each
but the MBR in the disk image says that partition 2 is 7D43H (32067dec)
sectors long or 16033.5 kB. Partitions 3 and 4 are 7D82H (32130dec) or
16065 kB. Somewhat confused by these results I decided to try using fdisk
on the SDcard. Fdisk reported that the total disk size in the MBR was
larger than the SDcard (this was probably what upset GParted). This could
also occur because not all "2GB" SDcards have the same number of available
sectors. I deleted partition 1 and then made a new one using the remaining
space on the card. GParted was now OK with the partition table and I
formatted partition 1 to FAT32.
I then followed the rest of Max's instructions and got a usable system
though, like the SDcard I made using Grant's method, it would sometimes
crash after printing "Booting CP/M 2.2". Thinking about these crashes I
remembered reading the note on Sergey's ParPortProp page for the V1.1 PCB
"Added C14 100 uF filter capacitor by SD card socket". I fitted a 220uF
capacitor between the 0V and 3.3V pads on the SDcard header pads. This
seems to have cured the intermittent crash on booting problem. Doing this
may help other people having problems with the SDcard. Just in case errors
had occurred during imaging I did re-run the image commands.
I then tried building my own SDcards using fdisk with 8MB and 16MB
partitions on 512MB SDcards. I will refer to these as 8MB or 16MB SDcards
from here on. Using fdisk I made partition 2 first, accepting the default
"leave 1 MB before it" (so it starts at sector 2048 - different from the
sector 63 start on Max's 2GB image), and specified the size as +8M and +16M
respectively. I then used the "t" command to make it a type 52 CP/M
partition. I repeated this process for partitions 3 and 4. Finally I made
partition 1 the rest of the disk and type 0b FAT32. GParted was used to
format the FAT32 partition. Note that the Linux fdisk command normally
prints the number of blocks in a partition using 1kB per block. In "expert"
mode the size is given in sectors.
I used dd to make a file of the MBR for each SDcard and then used the
binary editor to paste this over the MBR in Max's disk image. I then "dd"ed
the new images back to the SDcards and successfully booted into Max's
monitor program from each card. Using either of these SDcards the monitor
reliably crashes in the same fashion when using the image command after
printing "Image copy completed". For CP/M 2.2 and MP/M II imaging it
crashes and you have to use reset. For the CP/M 3 image it manages to crash
into the start code and prints "Extended Z80 Debug Monitor Version 0.3 by
Max Scane December 2014". This is 100% repeatable using either of the 8MB
or 16MB SDcards but does not occur using the MBR in Max's disk image.
The image command has probably worked correctly since CP/M 2.2 and CP/M 3
seem to be working OK when booted from the 8MB or 16MB cards but there is a
problem with MP/M II. Booting MP/M from Max's disk image works and the
"DIR" command when entered from the serial console (0A>) lists the
directory contents, but typing "DIR" on the second console (1A> which is
the VGA/PS2 on my machine) returns "DIR?". When MP/M is booted from either
of my 8MB or 16MB SDcards I get the "DIR?" response from entering "DIR" on
both consoles. Could it be that the MP/M problems are related to the lack
of an interrupt controller or has some part of the image process failed
when using the 8MB and 16MB disks?
I have attached the following files. "My512MBcard-8MBParts.txt",
"My512MBcard-16MBParts.txt" and "My2GBcardParts.txt" are partition table
printouts from fdisk for the 512MB disks I made with 8MB and 16MB
partitions along with that for Max's original disk image.
"fpga-session2GBcard.txt" is a capture of console output when using Max's
disk image and shows everything working correctly (I think).
"fpga-session-16MBParts.txt" is a capture of console output when using the
16MB partition SDcard and shows things going wrong including MP/M printing
"DIR?" right at the end. I have added comments to this file prefixed by
"*****".
"fpga-boot-test.zip" contains"fpga-boot-test-8MBParts.bin" and
"fpga-boot-test-16MBParts.bin" and are the disk images for the two 512MB
SDcards with 8MB and 16MB partitions respectively. Could some kind soul
please try putting these on an SDcard and see if they have the same
problems that I have (I could actually have a hardware problem)? Max, you
may be able to use them to find out why "image" crashes. These images can
be put on an SDcard larger than 512MB with the rest either unusable or the
FAT32 partition resized to the full capacity.
Thanks in advance for any assistance anyone can provide.
Cheers,
Ian.
Post by Max ScaneI have just posted an updated ZIP file which contains a bugfix to the
monitor.
There was a small problem where the monitor would hang after image
copying a file on a FAT16 file system.
This now works correctly and you can use FAT 16 or 32 for the FAT
partition. Thanks to Bo and Kip for spotting this one.
Note that it is very important to re-format the FAT partition once the
base OS has been copied to the SD card. This is because the three CP/M
partitions are inserted before the FAT partition and its starting address
on the disk is moved.
Max
Post by Max ScaneFor those people experimenting with the Multicomp, I have uploaded a
http://n8vem-sbc.pbworks.com/w/browse/#view=ViewFolder¶m=ROM-MJS
1. Extended debug monitor
2. CP/M 2 Disk image
3. CP/M 3 Disk Image
4 MP/M II Disk Image
The system boots from Grant's existing boot ROM so you don't have to
make any changes to the VHDL code. However, it does require a number of
extensions developed by James (eg, External RAM , MMU, Interrupts etc)
The base OS understands basic partition tables and supports 4 primary
partitions (type=52).
The disk images can be copied directly from the FAT partition (FAT 32)
to the destination partition which speeds up installation especially since
the Multicomp only has 1 disk.
Both CP/M 2 and 3 are partition independent so you can install them on
any partition but MP/M is tied to partition 4 for the time being.
You can install all or one OS as you please.
All the utilities work on CP/M 2, most on CP/M 3 and non on MP/M at the
moment.
There is a tool (FATDSK.COM) for file transfer between FAT volumes and
CP/M volumes and is supported on CP/M 2 and 3.
Documentation is sparse at the moment but there are some guides to help
installation. I will add more documentation when I get a chance.
Feedback is appreciated and I hope you have some fun!
Cheers!
Max
--
You received this message because you are subscribed to the Google Groups "N8VEM" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at http://groups.google.com/group/n8vem.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "N8VEM" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at http://groups.google.com/group/n8vem.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "N8VEM" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at http://groups.google.com/group/n8vem.
For more options, visit https://groups.google.com/d/optout.