libusb for DOS

View: New views
13 Messages — Rating Filter:   Alert me  

libusb for DOS

by Dimax :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everybody.
I need to provide DOS support for our device ( SUB-20
http://www.xdimax.com/sub20/sub20.html ).
Some motherboard manufacturing company wants to use it for testing on
production line and they all use DOS environment to save boot time and
a number of required connections (HD or CDROM).

Our Linux library is based on libusb 1.0 or libusb 0.1.
I wander if there were any efforts before to port any of libusb version to DOS.
I have found some free DOS usb UHCI OHCI drivers with URB support.
There is also GCC port for DOS called DJGCC.
So generally it looks like mission possible ?
What do you think. Any suggestions?

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Libusb-devel mailing list
Libusb-devel@...
https://lists.sourceforge.net/lists/listinfo/libusb-devel

Re: libusb for DOS

by Michael Plante :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>> I wander if there were any efforts before to port any of libusb version
to DOS.

None that I've heard of.


>> I have found some free DOS usb UHCI OHCI drivers with URB support.

Link?


>> So generally it looks like mission possible ?
>> What do you think. Any suggestions?

With enough effort, I don't see why not.  You do have free reign over all
the hardware, and, as I recall, DJGPP does give access to more than the
regular 1MB (via a DOS extender).  Suggestions depend on those drivers,
though.  I haven't used DJGPP in about 7 years, but I don't recall any
threading, so your app layer will probably need all blocking calls, unless
the drivers do something special with timer interrupts.

Michael



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Libusb-devel mailing list
Libusb-devel@...
https://lists.sourceforge.net/lists/listinfo/libusb-devel

Re: libusb for DOS

by Dimax :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Link?
http://www.georgpotthast.de/usb/

What do you think about it?


On Tue, Nov 10, 2009 at 3:54 PM, Michael Plante
<michael.plante@...> wrote:

>>> I wander if there were any efforts before to port any of libusb version
> to DOS.
>
> None that I've heard of.
>
>
>>> I have found some free DOS usb UHCI OHCI drivers with URB support.
>
> Link?
>
http://www.georgpotthast.de/usb/

>
>>> So generally it looks like mission possible ?
>>> What do you think. Any suggestions?
>
> With enough effort, I don't see why not.  You do have free reign over all
> the hardware, and, as I recall, DJGPP does give access to more than the
> regular 1MB (via a DOS extender).  Suggestions depend on those drivers,
> though.  I haven't used DJGPP in about 7 years, but I don't recall any
> threading, so your app layer will probably need all blocking calls, unless
> the drivers do something special with timer interrupts.
>
> Michael
>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Libusb-devel mailing list
> Libusb-devel@...
> https://lists.sourceforge.net/lists/listinfo/libusb-devel
>

Hi everybody.
I need to provide DOS support for our device ( SUB-20
http://www.xdimax.com/sub20/sub20.html ).
Some motherboard manufacturing company wants to use it for testing on
production line and they all use DOS environment to save boot time and
a number of required connections (HD or CDROM).

Our Linux library is based on libusb 1.0 or libusb 0.1.
I wander if there were any efforts before to port any of libusb version to DOS.
I have found some free DOS usb UHCI OHCI drivers with URB support.
There is also GCC port for DOS called DJGCC.
So generally it looks like mission possible ?
What do you think. Any suggestions?

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Libusb-devel mailing list
Libusb-devel@...
https://lists.sourceforge.net/lists/listinfo/libusb-devel

Re: libusb for DOS

by Michael Plante :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>> > Link?
>> http://www.georgpotthast.de/usb/
>>
>> What do you think about it?

No source to the driver, as far as I can tell.  Yes, everything will block
in that DPMI call.  I don't think you're going to get much help with this
here, to be honest.  I haven't had a bootable DOS environment on my HDD for
about a year, and I was essentially dismissed here for running a 1998
release (01 service pack, but who's counting) of a Win32 dev environment.
You might wait a couple days, to be sure.

But if you're good enough and it's worth their time/money, probably.  I
should point out that if the mobo manufacturer is troubleshooting their own
bugs this way, it would be nice if your software is as solid as possible
(and available for several OSes, to rule that out), and there's really no
easy way to know if those DOSUSB drivers are solid w/o source.  I understand
you can get extremely fast Linux boot times off of a solid-state disk
(certain distros, anyway, I've heard), possibly negating the boot time
effect your customer is worried about.  I'm not sure which connections they
want to avoid, but it's faster than a DOS floppy.  Of course, I don't know
what leverage you have, and if they manage to stuff DOS and your code in a
ROM, then nevermind...

I only skimmed the docs and a few example source files, but I didn't see
what the limit was on transfer size.  You have to know what memory is ok to
touch, to play nicely.  I suspect (did not see this explicitly mentioned)
that you may want to use PS/2 input devices to keep the BIOS off USB. :)
The docs were updated in 2008.  The dev looks responsive (couple hours,
based on the forums), so maybe you can interest him in the port.

Michael


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Libusb-devel mailing list
Libusb-devel@...
https://lists.sourceforge.net/lists/listinfo/libusb-devel

Re: libusb for DOS

by Peter Stuge-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dimax wrote:
> Our Linux library is based on libusb 1.0 or libusb 0.1.
> I wander if there were any efforts before to port any of libusb
> version to DOS.

Never has been, never will be I am fairly sure.


> I have found some free DOS usb UHCI OHCI drivers with URB support.
> There is also GCC port for DOS called DJGCC.
> So generally it looks like mission possible ?
> What do you think. Any suggestions?
..
> http://www.georgpotthast.de/usb/

libusb doesn't just need gcc - the library was written for unixishy
systems, so it simply does not fit well in DOS.

Of course you can spend (a lot of!) time on implementing a
compatibility layer, or (a little less) time on reimplementing your
driver on top of DosUSB, but there are many (including me) who would
recommend that you instead create an optimized Linux boot image for
your customer, which does what they want.


//Peter

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Libusb-devel mailing list
Libusb-devel@...
https://lists.sourceforge.net/lists/listinfo/libusb-devel

Re: libusb for DOS

by Tim Roberts :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dimax wrote:

> I need to provide DOS support for our device ( SUB-20
> http://www.xdimax.com/sub20/sub20.html ).
> Some motherboard manufacturing company wants to use it for testing on
> production line and they all use DOS environment to save boot time and
> a number of required connections (HD or CDROM).
>
> Our Linux library is based on libusb 1.0 or libusb 0.1.
> I wander if there were any efforts before to port any of libusb version to DOS.
> I have found some free DOS usb UHCI OHCI drivers with URB support.
> There is also GCC port for DOS called DJGCC.
> So generally it looks like mission possible ?
>  

It would be difficult to overestimate the level of effort involved in
this project.  DJGCC uses a DOS extender, which in turn needs some kind
of EMM provider.  Some of the motherboard manufacturing environments
don't even give you that.  For the one similar project I did (not a USB
device), I had to switch into "unreal mode" in order to access my
device's space.

DOS is going to force you into a synchronous model, so libusb 0.1 is
probably more likely, but it's going to be a complete rewrite.  Remember
that the Linux libusb sends ioctls to the Linux usbfs driver, whereas
your DOS USB library is going to use some completely different mechanism.

I don't know how much of the C runtime library DJGCC supports, but you
don't get threading, you don't get process control, you don't get a UI,
you don't get Linux syscalls, you don't get signals, you don't get mmap,
etc.

--
Tim Roberts, timr@...
Providenza & Boekelheide, Inc.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Libusb-devel mailing list
Libusb-devel@...
https://lists.sourceforge.net/lists/listinfo/libusb-devel

Re: libusb for DOS

by Dimax :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I've got another suggestion about DOS USB driver:
http://bretjohnson.us/
Any comments?

I'm not actually going to fully port libusb for DOS (at least at this stage)
All I need is
Open/Close
Bulk read
Bulk write


On Tue, Nov 10, 2009 at 7:55 PM, Tim Roberts <timr@...> wrote:

> Dimax wrote:
>> I need to provide DOS support for our device ( SUB-20
>> http://www.xdimax.com/sub20/sub20.html ).
>> Some motherboard manufacturing company wants to use it for testing on
>> production line and they all use DOS environment to save boot time and
>> a number of required connections (HD or CDROM).
>>
>> Our Linux library is based on libusb 1.0 or libusb 0.1.
>> I wander if there were any efforts before to port any of libusb version to DOS.
>> I have found some free DOS usb UHCI OHCI drivers with URB support.
>> There is also GCC port for DOS called DJGCC.
>> So generally it looks like mission possible ?
>>
>
> It would be difficult to overestimate the level of effort involved in
> this project.  DJGCC uses a DOS extender, which in turn needs some kind
> of EMM provider.  Some of the motherboard manufacturing environments
> don't even give you that.  For the one similar project I did (not a USB
> device), I had to switch into "unreal mode" in order to access my
> device's space.
>
> DOS is going to force you into a synchronous model, so libusb 0.1 is
> probably more likely, but it's going to be a complete rewrite.  Remember
> that the Linux libusb sends ioctls to the Linux usbfs driver, whereas
> your DOS USB library is going to use some completely different mechanism.
>
> I don't know how much of the C runtime library DJGCC supports, but you
> don't get threading, you don't get process control, you don't get a UI,
> you don't get Linux syscalls, you don't get signals, you don't get mmap,
> etc.
>
> --
> Tim Roberts, timr@...
> Providenza & Boekelheide, Inc.
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Libusb-devel mailing list
> Libusb-devel@...
> https://lists.sourceforge.net/lists/listinfo/libusb-devel
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Libusb-devel mailing list
Libusb-devel@...
https://lists.sourceforge.net/lists/listinfo/libusb-devel

Re: libusb for DOS

by Peter Stuge-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dimax wrote:
> http://bretjohnson.us/
> Any comments?

"the only type of host controller currently supported is UHCI"

Maybe that is OK for your use.

Also it looks like tens of thousands of lines of assembly. In each
file.

Maybe that is OK for your use.


//Peter

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Libusb-devel mailing list
Libusb-devel@...
https://lists.sourceforge.net/lists/listinfo/libusb-devel

Re: libusb for DOS

by Michael Plante :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>> Hi,
>> I've got another suggestion about DOS USB driver:
>> http://bretjohnson.us/
>> Any comments?
>>
>> I'm not actually going to fully port libusb for DOS (at least at this
stage)
>> All I need is
>> Open/Close
>> Bulk read
>> Bulk write

I don't think the objection was so much to the library you chose.  It's nice
that this one provides source.  The author of this one also seems
responsive, but the library looks much newer, and therefore probably has
more kinks to be worked out.  However many lines of assembly source is
potentially still better than a disassembly.  Again, you might just pick one
and talk to the author.  I see it as difficult, not impossible.  And
seriously consider trying to sway the manufacturer away from DOS (I haven't
seen any details on what you meant by limiting the number of connections).

Michael


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Libusb-devel mailing list
Libusb-devel@...
https://lists.sourceforge.net/lists/listinfo/libusb-devel

Re: libusb for DOS

by Tim Roberts :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Peter Stuge wrote:

> Dimax wrote:
>  
>> http://bretjohnson.us/
>> Any comments?
>>    
>
> "the only type of host controller currently supported is UHCI"
>
> Maybe that is OK for your use.
>  

Well, the world is never going to see a DOS EHCI driver.  The spec is
just too blinkin' complicated.

--
Tim Roberts, timr@...
Providenza & Boekelheide, Inc.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Libusb-devel mailing list
Libusb-devel@...
https://lists.sourceforge.net/lists/listinfo/libusb-devel

Re: libusb for DOS

by Michael Plante :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Tim Roberts wrote:

> Peter Stuge wrote:
> > Dimax wrote:
> >
> >> http://bretjohnson.us/
> >> Any comments?
> >>
> >
> > "the only type of host controller currently supported is UHCI"
> >
> > Maybe that is OK for your use.
> >
>
> Well, the world is never going to see a DOS EHCI driver.  The spec is
> just too blinkin' complicated.


Generally speaking, more important than lack of EHCI is lack of OHCI.  But
for some motherboard vendors, that may be ok.  I suspect (?) that's what
Peter was getting at.

Michael


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Libusb-devel mailing list
Libusb-devel@...
https://lists.sourceforge.net/lists/listinfo/libusb-devel

Re: libusb for DOS

by Dimax :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

After talking with customer I found out that they actually manufacture
network cards. They use test equipment based on SuperMicro motherboard
with ATA hard disk 2G memory Intel USB chipset and MSDOS on it.
Mentioned driver from http://bretjohnson.us/ was successfully tested
on this motherboard. So it makes integration much more realistic.

I also though about BIOS USB support. New BIOS can boot from USB
stick, so they have to support USB chipset. Perhaps they have some API
to access USB? Like for instance there are ports for PCI configuration
cycles access.



On Wed, Nov 11, 2009 at 10:23 PM, Michael Plante
<michael.plante@...> wrote:

> Tim Roberts wrote:
>> Peter Stuge wrote:
>> > Dimax wrote:
>> >
>> >> http://bretjohnson.us/
>> >> Any comments?
>> >>
>> >
>> > "the only type of host controller currently supported is UHCI"
>> >
>> > Maybe that is OK for your use.
>> >
>>
>> Well, the world is never going to see a DOS EHCI driver.  The spec is
>> just too blinkin' complicated.
>
>
> Generally speaking, more important than lack of EHCI is lack of OHCI.  But
> for some motherboard vendors, that may be ok.  I suspect (?) that's what
> Peter was getting at.
>
> Michael
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Libusb-devel mailing list
> Libusb-devel@...
> https://lists.sourceforge.net/lists/listinfo/libusb-devel
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Libusb-devel mailing list
Libusb-devel@...
https://lists.sourceforge.net/lists/listinfo/libusb-devel

Re: libusb for DOS

by Peter Stuge-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dimax wrote:
> After talking with customer I found out that they actually manufacture
> network cards. They use test equipment based on SuperMicro motherboard
> with ATA hard disk 2G memory Intel USB chipset and MSDOS on it.
> Mentioned driver from http://bretjohnson.us/ was successfully tested
> on this motherboard. So it makes integration much more realistic.

Ok. Have fun porting your driver to DOS.


> I also though about BIOS USB support.

Please don't.


> New BIOS can boot from USB stick, so they have to support USB
> chipset. Perhaps they have some API to access USB?

No. They are using System Management Mode to implement a virtual PS/2
keyboard, and using int 13h hooks to provide a virtual hard disk.

These two are the entry points, then there is communication with the
lower level USB stack. That communication of course uses some kind of
internal API in the BIOS, but you will not find any documentation.


Over in coreboot land you can find a few barebones UHCI HCDs. One is
in libpayload and another is in SeaBIOS. None of them are usable
as-is however, since I don't believe coreboot has support for any
Intel supermicro boards.

Depending on how much the customer wants to save time, you can of
course implement your entire software as a coreboot payload and most
likely have it running within a second or so after the CPU comes out
of reset. But porting coreboot can be a very big project.


> Like for instance there are ports for PCI configuration cycles
> access.

Note that the cf8/cfc ports are nothing like a BIOS API. They are
implemented by (all) PCI hardware, per the PCI standard.

A corresponding programming interface for USB would be UHCI, OHCI,
EHCI, XHCI (USB 3) or WHCI (wireless).


//Peter

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Libusb-devel mailing list
Libusb-devel@...
https://lists.sourceforge.net/lists/listinfo/libusb-devel