🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc
Article #15673

Re: Writing to Directories

#15673
From: bill
Date: Mon, 09 Feb 1987 16:58
42 lines
1833 bytes
You can always find the root directory on a DOS disk by looking at the
Bios Parameter Block in the disk's boot sector:

	Read boot sector (track 0, head 0, sector 1).
	You should see something like the following:

	0000	jmp	somewhere	;3-byte jump instruction

	0003	db	"IBM  3.2"	;8-byte revision string

	000B	dw	512		;(word) Bytes per sector
	000D	db	4		;(byte) Sectors per cluster
	000E	dw	1		;(word) Number of reserved sectors
	0010	db	2		;(byte) Number of FATs
	0011	dw	512		;(word) Number of root dir entires
	0013	dw	41735		;(word) Total sectors on the media
	0015	db	0F8h		;(byte) Media descriptor
	0016	dw	25		;(word) Sectors per FAT
	0018	dw	17		;(word) Sectors per track
	001A	dw	4		;(word) Number of heads
	001C	dw	17		;(word) Number of hidden sectors
	...


	You find the start of the root directory by adding up the following:

		  (Number of FATs)*(Sectors per FAT)
			+   Number of hidden sectors
			+ Number of reserved sectors
		------------------------------------
		=     First sector of root directory

	You can now use the DOS absolute sector read service (Int 25h)
	to read the directory, which will occupy contiguous sectors
	starting with the one you've calculated.


bill frolik
hp-pcd!bill
Hewlett-Packard Portable Computer Division
Corvallis, Oregon
Technical Details
Message-ID: <1610005@hpcvlo.HP.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!sri-unix!hplabs!hp-pcd!hpcvlo!bill
References: <2377@dalcs.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!sri-unix!hplabs!hp-pcd!hpcvlo!bill
From: bill@hpcvlo.UUCP
Newsgroups: comp.sys.ibm.pc
Subject: Re: Writing to Directories
Message-ID: <1610005@hpcvlo.HP.COM>
Date: Mon, 9-Feb-87 11:58:05 EST
Article-I.D.: hpcvlo.1610005
Posted: Mon Feb  9 11:58:05 1987
Date-Received: Thu, 12-Feb-87 00:22:36 EST
References: <2377@dalcs.UUCP>
Organization: Hewlett-Packard Co., Corvallis, OR, USA
Lines: 42