Page MenuHomeFreeBSD

New ufdformat(1) utility
Needs ReviewPublic

Authored by cy on Dec 4 2017, 5:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Feb 28, 6:34 AM
Unknown Object (File)
Wed, Feb 18, 2:31 PM
Unknown Object (File)
Mon, Feb 16, 1:49 AM
Unknown Object (File)
Sun, Feb 15, 12:29 PM
Unknown Object (File)
Sun, Feb 15, 2:04 AM
Unknown Object (File)
Sun, Feb 15, 1:11 AM
Unknown Object (File)
Tue, Feb 10, 5:36 PM
Unknown Object (File)
Mon, Feb 9, 12:08 AM

Details

Reviewers
bms
imp
jhb
Group Reviewers
manpages
Summary

This new ufdformat(1) utility (originally written by bms@) performs a low level floppy disk format in a similar manner to fdformat(1) but using a USB floppy drive.

Test Plan

make tinderbox

Tested on a TEAC FD-05PUW 3000: pass.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 13316

Event Timeline

The command is actually 'ufdformat', not 'usbformat'.

Yes. It performs the same function as fdformat(1) except that it only performs a low level format floppy disks using USB floppy drives. To name it usbformat would imply it formats other umass devices, which it does not.

The point I'm making is the Phabricator review calls it "usbformat", NOT "ufdformat".
Both in the subject of the review, as well as the summary of the review.

cy retitled this revision from New usbformat(1) utility to New ufdformat(1) utility.Dec 4 2017, 2:39 PM
cy edited the summary of this revision. (Show Details)

Thanks for pointing that out (long day yesterday). Fixed.

camcontrol is the traditional location for this functionality, though that obscures things. And there's issues with the integration there, so here might not be bad. Some of the code belongs in libcam, however at the very least.
The manual section should be 8, not 1 (fdformat is bogusly located in section 1). Maybe this is too fine a point.
I tend to agree with the 'move to kernel / libcam comments'

usr.sbin/ufdformat/scsi_util.c
295–297

there should be a libcam function to do this already....

396–400

should be a libcam routine to do this already

We could move the functions and similar ones used by camcontrol(8) to libcam. What if I open a new revision first to do just that?

Re the volume 1 manpage, I was puzzling over why fdformat(1) was in volume 1 too. I will volume 8 and move this man page to volume 8 as well.

wblock added inline comments.
usr.sbin/ufdformat/ufdformat.1
46
can be given as the full path
48
(like
50
or as an short device name that is located in``
51

Remove this line.

53
(like
56
The options are:
62

Break the sentence here.

.Xr fdcontrol 8 .
63
The default is 1.44MB.
73
Do not ask for confirmation about formatting the floppy disk, but
79
flag has not been specified, ask the user for confirmation
81
To continue, an answer
89
To create
109

s/has been/is/

110

Don't need "finally".

113

s/will be/are/

118

Break the sentence:

1 is returned on any errors during floppy formatting.
An exit status
119
of 2 reflects invalid arguments given to the program, along with
120
appropriate information written to diagnostic output.
138

Ummm.... copy/paste error? ufdformat didn't appear in FreeBSD 6, unless I'm mistaken.

Did this ever land? I've been away for over 7 years... I remember hacking on this in my apartment share on Shattuck & Francisco in Berkeley, 2004.

This hasn't landed. the feedback from way back wasn't addressed. We can restart. I see several things in this code just glancing at it that I didn't understand well enough to comment on years ago.

In D13356#1262434, @imp wrote:

This hasn't landed. the feedback from way back wasn't addressed. We can restart. I see several things in this code just glancing at it that I didn't understand well enough to comment on years ago.

Sure. Let me find the sources again. I don't think I copied my SVN patches to GIT.

Imported into my GIT repo. I will review the code and make any changes needed to get it working again.

In D13356#1262904, @cy wrote:

Imported into my GIT repo. I will review the code and make any changes needed to get it working again.

OT: Hello Cy. Yes, I tried to send you a text message at the start of the year, but I think your cell number has changed since 2014. I want to make it out to BC again at some point this year as a friend from my high school days has had the operation to become Canadian, I believe.

In D13356#1263008, @bms wrote:
In D13356#1262904, @cy wrote:

Imported into my GIT repo. I will review the code and make any changes needed to get it working again.

OT: Hello Cy. Yes, I tried to send you a text message at the start of the year, but I think your cell number has changed since 2014. I want to make it out to BC again at some point this year as a friend from my high school days has had the operation to become Canadian, I believe.

Send an email to my FreeBSD.org email address. It will forward to my inbox here at home. I can share my new (now personal) phone number with you. The old phone was a work phone and that changed when they split the group.

I have a usb floppy disk. It attaches to the system as /dev/da0. I can test this this weekend.

I have a usb floppy disk. It attaches to the system as /dev/da0. I can test this this weekend.

I don't think this works anymore. I will need to review the comments, refactor into multiple commits (i.e. move some functions to libcam and finally import what is left into /usr/sbin).

The code did work at the time. (I still have the two Teac USB floppy drives in a computer bag here. Additional testing will be helpful.)

In D13356#1263785, @cy wrote:

Send an email to my FreeBSD.org email address.

done/done