Autor
| MSX boot
|
zeilemaker54 msx lover Mensajes: 97 | Publicado: Noviembre 22 2005, 22:18   |
Quote:
| In the first line you mention DiskBasic 1.0, but the rest of the description says "MSXDOS2.x". I can't imagine DiskBasic 1.0 checking for DOS2 :-)
|
As you later mentioned, this is MS-DOS 2.x. In MS-DOS2.x the BPB (Bios Parameter Block) was introduced in the bootsector. This contains all kinds of diskparameters. It is located at offset &H3 and ends at offset &H1D (later versions of MS-DOS use a bigger version of the BPB). The presents of a BPB is indicated by either a &HE9 or &HEB at offset 0 (this is a Intel 8086 JMP instruction!). That is why the MSX bootloader start at offset &H1E, just behind the BPB!!!
Wierd thing about the diskkernel 1.00 and most diskdrivers is, that they do not use the BPB. They are using the mediadescriptorbyte which is read from sector 1 offset 0. But this methode is mentioned in the MSX technical data book, so all manufactures use it.
I have rewritten my Sony HB-F700P diskdriver to use the BPB if it is present and works fine too.
Quote:
| Weird. The disk system already did read sector 0 (see above); why should it fail here?
|
At first glance this is a complete waste, but the second read of the bootsector is part of a routine which tries to start MSX-DOS. This is not only called at boottime, but also when a CALL SYSTEM is invoked. Lazy programmer  |
|
pp msx novice Mensajes: 27 | Publicado: Noviembre 23 2005, 07:41   |
What did you use to disassemble the ROM's ? DISASS ? Did you see any bios calls in the code ?
I need this for a little project.
pp
|
|
pp msx novice Mensajes: 27 | Publicado: Noviembre 23 2005, 07:49   |
Question for the real MSX addicts:
What is the first Z80 instruction processed when you switch on your MSX ?
pp
|
|
AuroraMSX
 msx master Mensajes: 1260 | Publicado: Noviembre 23 2005, 09:51   |
Quote:
| Quote:
| Weird. The disk system already did read sector 0 (see above); why should it fail here?
|
At first glance this is a complete waste, but the second read of the bootsector is part of a routine which tries to start MSX-DOS. This is not only called at boottime, but also when a CALL SYSTEM is invoked. Lazy programmer 
|
Aah, does that imply that if I'm in DiskBASIC, insert a disk containing MSXDOS, and do POKE &hF346,1:_SYSTEM this is the exact point where the MSX-DOS initialization procedure begins? |
|
NYYRIKKI msx master Mensajes: 1525 | Publicado: Noviembre 23 2005, 12:16   |
Quote:
| Question for the real MSX addicts:
What is the first Z80 instruction processed when you switch on your MSX ?
|
It is instruction in address 0 in slot 0-0... DI, IIRC. |
|
zeilemaker54 msx lover Mensajes: 97 | Publicado: Noviembre 23 2005, 14:27   |
Quote:
| What did you use to disassemble the ROM's ? DISASS ? Did you see any bios calls in the code ?
I need this for a little project.
pp
|
I use Z80DIS 2.2 by Kenneth Gielow. It is a CP/M program, so no MSX specific labels are used. I myself replace labels with the MSX-BIOS call labels. To modify the output from Z80DIS in useable source is taking the most time for sure.
You can specify area´s of code, text, bytes, word etc. It is really a nice program to use! |
|
HansO msx addict Mensajes: 375 | Publicado: Noviembre 23 2005, 14:35   |
Quote:
| Question for the real MSX addicts:
What is the first Z80 instruction processed when you switch on your MSX ?
pp
|
0000 F3 BEGIN: DI
Easy to find in the MSX BIOS listing page 2  |
|
zeilemaker54 msx lover Mensajes: 97 | Publicado: Noviembre 23 2005, 14:35   |
Quote:
| Aah, does that imply that if I'm in DiskBASIC, insert a disk containing MSXDOS, and do POKE &hF346,1:_SYSTEM this is the exact point where the MSX-DOS initialization procedure begins?
|
Well allmost. CALL SYSTEM does the following:
- Check if no parameters are specified (e.g. end of basic statement). Note: kernel 1.00, kernel 2.x has an extra parameter.
- If not, quit (which generates a "syntax error" 
- Check (&HF346)<>0 (this indicates that MSX-DOS was loaded at boottime).
- If not, quit with "illegal function call" error
- Close all I/O channels (files that are in use by OPEN statements)
- Force textmode
- Disable display of the functionkeys
Then the "Start MSX-DOS" routine is called.
|
|
zeilemaker54 msx lover Mensajes: 97 | Publicado: Noviembre 23 2005, 14:48   |
Quote:
|
0000 F3 BEGIN: DI
Easy to find in the MSX BIOS listing page 2 
|
Correct. If your MSX is started (cold start), the Z80 automatic has the interrupts disabled, so this instruction is not needed. But if you do a warm start (e.g. jump to adres 0 in BIOS-ROM), interrupts may be enabled. The startup routine does all kinds of nasty things with slots and hardware, so leaving the interrupts on crashes the startup for sure. That is why the DI instruction is the first instruction! |
|
zeilemaker54 msx lover Mensajes: 97 | Publicado: Noviembre 23 2005, 16:07   |
Quote:
| Quote:
| I have spent quite a bit of time in disassembling the various MSX roms. I am looking for a method to publish the assembly source somewhere on the internet. So everone can look at the code, and may be create a custom version of the dos kernel. But I am not sure if publishing is legal (because of the copyrights).
At the moment I am busy modifing the kernel 2.31 to support FAT16 (so no need to patch the kernel with FAT16.COM), but other modification are possible with my source at hand.
Like to hear your reactions...
|
I already have a nice collection of sources of diskroms on my site. And store the files on funet. So if I can help let me know.
|
Thanks for your sugestion Hans. The sources I have are functional (you can use them to recreate the rom files), but they are not fully commented yet. I would like to fully commented these sources (may be with help from the MSX community) and do some version administration. Can you provide an easy way of updating the files ?
May be I will host the files on my own webserver, where I can easily update the files. But I am not sure how to do the version administration. May be someone knows some good software to do this....
|
|
AuroraMSX
 msx master Mensajes: 1260 | Publicado: Noviembre 23 2005, 16:48   |
Quote:
| But I am not sure how to do the version administration. May be someone knows some good software to do this....
|
I used to host CVS on a private server: pretty easy to configure and even easier to use. ViewCVS provides a nice web interface for CVS, although viewing only. Sourceforge uses CVS, too. Subversion would be another option, but I haven't used that yet. |
|
HansO msx addict Mensajes: 375 | Publicado: Noviembre 23 2005, 20:36   |
I can offer space as part of my Info pages. CVS is indeed a way to manage sources and versions etc online, sourgeforce is a good example. I dont have that planned for my website, as I see that more as a resource page of more or less static information.
Anyway, I and many others would love to see those sources online, can help you do that in a simple way, and most certainly will point to it from my pages wherever it will come online!
|
|
pp msx novice Mensajes: 27 | Publicado: Noviembre 24 2005, 08:03   |
Quote:
| Quote:
| What did you use to disassemble the ROM's ? DISASS ? Did you see any bios calls in the code ?
I need this for a little project.
pp
|
I use Z80DIS 2.2 by Kenneth Gielow. It is a CP/M program, so no MSX specific labels are used. I myself replace labels with the MSX-BIOS call labels. To modify the output from Z80DIS in useable source is taking the most time for sure.
You can specify area´s of code, text, bytes, word etc. It is really a nice program to use!
|
Okay, how can I run CP/M on my MSX then ? I'm a newbee as you can see !
I'm having a NMS8245 to work on.
Will I be an outlaw if I use this to find a game secret in a Konami ROM ? I'm desperate to find the secret of this game. As long as I do not publish the code I'm on the right side, right ?
|
|
NYYRIKKI msx master Mensajes: 1525 | Publicado: Noviembre 24 2005, 08:32   |
Quote:
|
Okay, how can I run CP/M on my MSX then ? I'm a newbee as you can see !
|
You don't need to. MSX-DOS runs CP/M programs just fine. MSX is used to be backward compatible, you see.  |
|
zeilemaker54 msx lover Mensajes: 97 | Publicado: Noviembre 25 2005, 12:48   |
Offtopic: There is a secret programmer message in the DOS kernel 1.00 (Diskbasic 1.0, later versions do not have this ´feature´). If you boot MSX-DOS and do the following at the dos prompt, the programmers of the DOS kernel 1.00 are shown:
input exactly 127 characters (any character is ok)
press CTRL-J
press BS
Not very usefull, but funny....
|
|
|
|
|