Bootsector format?

This is the best place to discuss about the various Oric operating systems like Sedoric, Randos, FT-Dos, and others, as well as serious software, utilities, word processors, disassemblers, etc... that runs on oric computers.
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Bootsector format?

Post by Dbug »

Hi,

I'm currently working on a better version of the 'Defence Force Floppy Builder', which will become a standard part of the OSDK and will provide an easy way to create floppy based games. It is already possible to make these using Tap2DSK, but it is not very efficient for games or demos because it uses the normal operating system to load data, which means that 1) you do not have access to the overlay ram anymore and 2) a lot of disk space is wasted because the OS is present.

The current version of the Floppy Builder has been used since 2002, VIP4, Barbitoric, Quintessential, Born in 1983, ... all have been built with this tool.

The main issue, is that this tool is not able to create floppies, all it knows is how to patch them to insert data and make them bootable, which means that you have to provide a DSK file at the correct format at the source. It also means that any extra information that was present on the original disk is still present on the new one, which is not very tidy :)

The modifications I'm doing are based on informations gathered from Fabrice's tools, Twilighte's old messages, Sedoric A Nu, WDC datasheets, etc... and will hopefully allow me to make a version that can generate clean floppies with whatever parameter you want (16, 17 or even 18 sectors).

Right now my problem is the boot sector.

What I have is a bunch of 23 undocumented bytes, followed by 233 bytes of actual executable code:
00 00 FF 00 D0 9F D0 9F 02 B9 01 00 FF 00 00 B9 E4 B9 00 00 E6 12 00
The only information I have, is that the final 00 indicates it is a Master floppy, if it had been 01 it would have been a Slave floppy.

Does anyone know what the 22 previous bytes are used for? Do they have the same meaning for an Atmos with a Microdisc or for a Telestrat? Will the floppy still boot if I write other values?

Thanks for any helpful answer :)

As far as I figured out, only the 3 first sectors or the first track are required by the Microdisc boot sequence, which means I'm pretty much free to use the rest as I want.
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Bootsector format?

Post by Chema »

Hi Dbug. I'm sorry I cannot be of help here, but I find this extremely interesting. Do you plan to do something similar to Fantasmagoric which boots in any system? Or something based on Sedoric?

I am really interested!
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Bootsector format?

Post by Dbug »

I'd like to do something like Fantasmagoric, but the code will be different for a number of reasons, one being that for fast loaders 256 bytes sectors are much better than 512 ones (plus I could not care less about MSDOS compatibility).

So basically, as soon as I have the code working for Microdisc/Telestrat, I will take a look on how to make it work on Jasmin as well (and why not, Pravetz controllers), I guess that will depend of how difficult it is to make a compatible 'read sector' and 'switch overlay' code.
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Bootsector format?

Post by Symoon »

Interesting!
The beginning of the datas you're trying to analyse looks a bit like a file descriptor (see Sedoric à Nu p. 497).
As far as I understand, there are two special files with their own special directory on boot, so this might be some minimal informations to load at least one of the files?

Not much spare time to dig further, sorry...
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Bootsector format?

Post by Chema »

Dbug wrote:I'd like to do something like Fantasmagoric, but the code will be different for a number of reasons, one being that for fast loaders 256 bytes sectors are much better than 512 ones (plus I could not care less about MSDOS compatibility).

So basically, as soon as I have the code working for Microdisc/Telestrat, I will take a look on how to make it work on Jasmin as well (and why not, Pravetz controllers), I guess that will depend of how difficult it is to make a compatible 'read sector' and 'switch overlay' code.
I might be of help in the latter. I have Fabrice's code for reading/writing sectors which worked in Jasmin/Microdisc/Telestrat (at least) by using indirections in page 4. When you are at that stage, let me know. This code, however, was based in 512 byte FAT compatible sectors. Not sure if it would be difficult to adapt.

I understand you don't care about FAT compatibility. The only reason why this might be interesting is the possibility of formatting and writing a disk directly from a PC without the need of tools such as writedsk, which doesn't work well in modern OS, if I recall correctly.
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Bootsector format?

Post by Dbug »

Many modern motherboards are not even able to handle 42 tracks/3" floppy drives anyway, so the problem is getting less and less relevant :)

Assuming you have a 3.5" drive, you can probably do the equivalent of the MSA format on the Atari ST, and for example store the DSK file on the 80 track floppy, and then write it down on a 40 track drive (games and demos should stick to the common denominator which is the 4x tracks drives anyway).
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Bootsector format?

Post by Dbug »

Symoon wrote:Interesting!
The beginning of the datas you're trying to analyse looks a bit like a file descriptor (see Sedoric à Nu p. 497).
As far as I understand, there are two special files with their own special directory on boot, so this might be some minimal informations to load at least one of the files?

Not much spare time to dig further, sorry...
It indeed looks a bit like that, at least the sector chaining information (00 00 FF) and what could be the start address, but then it falls because the end address would be the same as the end address, then again the 'number of sectors' could match (01 00).

Mhmmm :D
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Bootsector format?

Post by Chema »

Hi Dbug. You made your point about FAT compatibility. I always forget less and less computers nowadays support floppies :)

About this matter, have you taken a look at tap2dsk? I found this code in the store_file routine which seems to fill up the file descriptor. It is not complete, but indicates how some information is stored. The first two bytes start at 0,0 and then, if needed, store the track/sector chain information, as you said.

Code: Select all

	int start=(header[6]<<8)+header[7];
	int end=(header[4]<<8)+header[5];
	int exec=header[3];
	int block=header[2];
	int sectors=(end-start)/sizeof(sector)+1;
	int desc_sect,desc_track;
	int desc_off=0x0C;
	int offset;

	memset(descriptor,0,sizeof(sector));
	find_free_sector(descriptor);
	desc_track=track; desc_sect=sect;
	descriptor[2]=0xFF;
	descriptor[3]=(block?0x40:0x80)+(exec?1:0);
	descriptor[4]=header[7];
	descriptor[5]=header[6];
	descriptor[6]=header[5];
	descriptor[7]=header[4];
	if (exec) {
		descriptor[8]=descriptor[4];
		descriptor[9]=descriptor[5];
	} else {
		descriptor[8]=descriptor[9]=0;
	}
	descriptor[10]=sectors&0xFF;
	descriptor[11]=sectors>>8;
Then it continues with the filename and other parameters.

Maybe it is unrelated to your problem, though... Just a guess..

Cheers.
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Bootsector format?

Post by Symoon »

I recall having read that the boot system of Sedoric had to cope with the way the Oric DOS was working. So maybe a good idea would be to look for information about this previous DOS. Maybe that explains why this part is not described in Sedoric à Nu, it may be a previous DOS code?

Now guys, you'll have to dig you old docs, Theoric, Micr'Oric, mags and books...
Or old disk images to check ;)
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Bootsector format?

Post by Dbug »

Symon: I will dig in the documentation, is there some master index of all the articles of all Ceo mags somewhere :D ?

I did some attempts, I now have a floppy that boots both on Microdisc and Jasmin - at least in emulators.

You can find it here:
DualBootFloppy.DSK
Jasmin/Microdisc dual boot
(525.25 KiB) Downloaded 798 times
Now of course it's only the boot, so it's not yet a usable Jasmin demo because I still need to implement a loader, but technically the root is there, and the FloppyBuilder code is now able to handle multiple boot sector sources.

So what this demo does is:
- If on Microdisc (Atmos or Telestrat) or compatible system (Cumana, Cumulus), then it boots the Solskogen demo normally.
- If on Jasmin, it shows an error message saying that the system is not supported.
(Testing and reporting issues is highly recommended)

I've no idea on how Dos 8D (Pravetz) works, if anyone as documentation on the floppy structure, controller type, code to read sectors and enable overlay... I'm interested :)

When I will be done with my tests I will release the whole package:
- nice and clean floppy builder with errors messages that actually help (ie: How many bytes remaining in the boot sectors, or how many you have in excess)
- understandable file description syntax
- and hopefully the possibility to build floppies from scratch (ie: not requiring a source floppy to clone from)
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Bootsector format?

Post by Symoon »

Dbug: on the latest quarterly CEO disk, André added my CEO Mag search engine, that indexes the first 80 issues. He also has indexing informations on his website:
http://andre.cheramy.net/ceomag/Index.htm
User avatar
iss
Wing Commander
Posts: 1637
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Bootsector format?

Post by iss »

Hi Dbug, the task you started is real challenge. I follow discussion with big interest and I'm ready to help with Pravetz compatibility.
Unfortunately the structure and the whole "architecture" of Dos8D is completely different from Sedoric.
Important are some limitations of hardware:
- 35 tracks / 16 sectors / 256 bytes per sector (or total 140k).
- boot code in FDC ROM reads and executes track 0, sector 0.
- documentation is close to none.
Anyway, I spent lot of time in disassembling and reversing Dos8D and now I have working routines for read/write sectors and format track. I fixed in source all absolute offsets, so it can be assembled and used from any start address (or can be linked as 'object' module). Source needs just to be cleaned from some unused code (i.e routines not related to sector level). Overlay switching is clear too.
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Bootsector format?

Post by Dbug »

iss wrote:Hi Dbug, the task you started is real challenge. I follow discussion with big interest and I'm ready to help with Pravetz compatibility.
Unfortunately the structure and the whole "architecture" of Dos8D is completely different from Sedoric.
Technically we do not care about Sedoric at all, what we care is about a disk format that can be read by the hardware/bios of the controller.
iss wrote:Important are some limitations of hardware:
- 35 tracks / 16 sectors / 256 bytes per sector (or total 140k).
- boot code in FDC ROM reads and executes track 0, sector 0.
- documentation is close to none.
Anyway, I spent lot of time in disassembling and reversing Dos8D and now I have working routines for read/write sectors and format track. I fixed in source all absolute offsets, so it can be assembled and used from any start address (or can be linked as 'object' module). Source needs just to be cleaned from some unused code (i.e routines not related to sector level). Overlay switching is clear too.
(Generally conventions states that track numbers are zero based and sector numbers are one based)

So the boot sector is at the same location as on the Jasmin (first sector of the first track), which means we need to find a way to detect which one booted it.
Could you try my floppy and see if you get the boot sector to work on it?

If it does not work it means that:
- the floppy was refused by the bios and did not even try to load it
- either it did not load the code at $400, so the bootsector crashed

If it works it means that:
- You drive accepts floppies formated with 17 sectors

Question: Are Pravetz drives single side only, or is there double sided models? If they are only single sided, then I guess it means we need the user to 'change side' and need to detect that the new side is inserted and continue loading.

If I want to test the Pravetz mode, how can I test that? Is it fully compatible/working in Oricutron, is there some Dos8D floppy I can test things with? How does it work, how does it boot, what are the commands, etc... :) ?
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Bootsector format?

Post by Symoon »

Dbug wrote:
Symoon wrote:Interesting!
The beginning of the datas you're trying to analyse looks a bit like a file descriptor (see Sedoric à Nu p. 497).
As far as I understand, there are two special files with their own special directory on boot, so this might be some minimal informations to load at least one of the files?

Not much spare time to dig further, sorry...
It indeed looks a bit like that, at least the sector chaining information (00 00 FF) and what could be the start address, but then it falls because the end address would be the same as the end address, then again the 'number of sectors' could match (01 00).

Mhmmm :D
Forgot to reply: start address = end address means 1 byte long. Could it be a RTS, just a fake program to have a sector read somewhere? Or more likely, this is the loading start address then the execution start address (9FD0) - which are matching, and then the end address (B902)?
That would make a big file though.

Do you know if these values also exist on OricDos disks ? (didn't have time to take a look at disk files yet)
User avatar
iss
Wing Commander
Posts: 1637
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Bootsector format?

Post by iss »

Dbug wrote:... what we care is about a disk format that can be read by the hardware/bios of the controller.
Good.
Dbug wrote:(Generally conventions states that track numbers are zero based and sector numbers are one based)
((Generally true only for PC because of BIOS int 13h else in Dos8D and in the original Apple][ DOS 3.x it's zero based. Anyway, not important for me, so I'll not fight for this.))

Here is the extended version of previous hardware limitations:
- 35 tracks / 16 sectors / 256 bytes per sector (or total 143 360 bytes).
- single side only.
- $310 .. $31F - FDC registers.
- $320 .. $3FF - FDC ROM bootstrap code.
- bootstrap reads first sector from track 0 and executes it from address $B800.

Obviously DualBootFloppy.DSK will not work.

Fortunately Oricutron (with my small contribution :twisted:) emulates 100% FDC and works perfect with Dos8D.
There are 4 versions of Dos8D: 1.00, 1.31, 2.10 and 2.31. Versions 1.xx use RAM starting from address $6600.
Versions 2.xx are 'HIRAM' i.e. entirely are in RAM overlay. Attached are images for Oricutron and short User's guide.

So, in common a 'TripleBootDisk' it's doable. :D But first we need to support Microdisk/Jasmin type images (or kind of) with 8D FDC in Oricutron.
130.dsk.zip
(7.37 KiB) Downloaded 763 times
231.dsk.zip
(7.48 KiB) Downloaded 751 times
8dos-reference.pdf.zip
(233.3 KiB) Downloaded 1081 times
Post Reply