China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-31 21:01
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » Regarding the issue of accessing the USB controller under DOS, please help from the experts, thank you View 4,452 Replies 9
Original Poster Posted 2003-07-10 00:00 ·  中国 上海 电信
初级用户
Credits 111
Posts 2
Joined 2003-07-10 00:00
23-year member
UID 6695
Gender Male
Status Offline
I'm a senior student in the computer department of a university. I'll be looking for a job half a year later. Everyone knows that it's hard to find a job these days.

During the last summer vacation, I got an unpaid internship in a company. Of course, I want to stay. This time I've come into contact with very low - level things. Especially this time I encountered a very difficult technical problem, and I'm very worried about whether I can do this well. Now let me briefly describe this problem. Please point out if there are any basic problems in the description, because it's the first time I'm doing such a low - level program.

The TEAM I joined is developing a solution. The main programs in it run just after the computer is booted and before the operating system is entered (it's a bit similar to the boot program of a hard disk protection card). In this program running almost on bare metal, there is a function to access a self - developed USB peripheral hardware of the company.

My module is centered around this. The driver of this USB hardware under WINDOWS has long been completed, but in the bare - metal assembly environment, the form is completely different, which makes me at a loss.

Later, I saw such a program URL on your website: http://newdos.yginfo.net/dosware/usbdrv.zip
This program can make DOS support USB devices. The program is not large.

Then I read some information about USB and combined with the understanding of the program, I drew the following conclusions:
1. If assembly or DOS wants to access the USB interface, it needs to address the USB controller chip through I/O addresses for operations, such as initialization and sending data, which are all I/O operations on the USB controller.
2. If my assembly application program is to perform operations on this hardware to a certain purpose, first, there should be a USB controller driver, which packages the underlying operations on the controller. Then, based on the controller driver, I develop a device driver for my USB device that calls the controller driver.
The diagram is as follows
Assembly application program <--- > My USB device's driver module <--- > USB controller driver <-- > USB controller < - > USB peripheral

Looking at the DUSE program downloaded from your website again, although it's for DOS, its function is similar to the module I want to do. Especially the USB controller driver. I find that it's the underlying core of the DUSE program. The driver programs of various different devices just call it, but I know nothing about it; if I can directly send and receive data to the USB interface on the basis of it, how to communicate with my USB peripheral, I'm very familiar with instructions.

I don't know if my expression is clear. My final goal is to use assembly to access the USB interface and send data to control a specific USB device developed by the company under bare metal (I know the control instructions of this device).
Please experts give guidance on how to make a general USB controller driver module (I see that DUSE can be used on various machines). It's best to have relevant code that can be directly referred to. Time is pressing for my job. I'm doing this for my job. Thank you, experts. I'm in Shanghai. If this matter is done well, I will definitely invite you to dinner.

My EMAIL: dellweiwei@hotmail.com
Floor 2 Posted 2003-07-12 00:00 ·  中国 上海 鹏博士宽带
初级用户
Credits 111
Posts 2
Joined 2003-07-10 00:00
23-year member
UID 6695
Gender Male
Status Offline
hehe, I went to the Computer Doctoral Laboratory of Donghua University today and found the answer there. It seems that the technology here is still limited.
Floor 3 Posted 2003-07-12 00:00 ·  中国 北京 科技网
银牌会员
★★★
颓废青年
Credits 2,265
Posts 721
Joined 2003-05-12 00:00
23-year member
UID 2032
Gender Male
Status Offline
Would Zen Buddhism be interested?
Floor 4 Posted 2003-07-16 00:00 ·  中国 广东 东莞 电信
元老会员
★★★
CEO
Credits 1,019
Posts 300
Joined 2002-10-20 00:00
23-year member
UID 33
Gender Male
From 广东
Status Offline
Yeah, I'm interested in this aspect . I wonder if the original poster can post it?
禅宗——大道至简,知易行难!
网站: http://www.dgzens.com

QQ: 11951692 微信: dgzens
E-MAIL: warmrose@21cn.com
Floor 5 Posted 2006-09-08 05:33 ·  中国 上海 浦东新区 电信
新手上路
Credits 6
Posts 5
Joined 2006-09-07 01:34
19-year member
UID 61997
Status Offline
The LZ posts the answer, let the younger generation also come to learn!
Floor 6 Posted 2006-09-08 05:56 ·  中国 湖南 长沙 电信
中级用户
★★
Credits 282
Posts 126
Joined 2006-05-17 22:29
20-year member
UID 55724
Status Offline
Follow!

I'm very interested in USB right now.

The drivers for USB are divided into three layers:
Host controller driver
Device class driver
Application driver

Windows already comes with common device class drivers.
The host controller driver is provided by the motherboard driver.
When writing drivers, you only need to write the application driver according to the characteristics of the device.


But under DOS, you have to write all three layers of drivers by yourself.

Now I'm getting dizzy from the UHCI specification downloaded from the Intel website.
人类存在的目的就是试图理解人类为何存在
Floor 7 Posted 2006-09-08 22:39 ·  中国 香港
银牌会员
★★★
阿林
Credits 1,410
Posts 497
Joined 2004-06-28 00:00
22-year member
UID 27551
Gender Male
From 九龍,香港
Status Offline

There are already USB driver examples online, such as Georg Phtthast's DOSUHCI, but it is written in PowerBASIC, which many people can't understand, and it's paid, so it's relatively unpopular.

mailbox@georgpotthast.de
我 的 網 站 - http://optimizr.dyndns.org
Floor 8 Posted 2007-07-03 15:03 ·  中国 河北 唐山 联通
初级用户
Credits 62
Posts 28
Joined 2007-07-03 11:20
19-year member
UID 93017
Gender Male
Status Offline
Just passing through
Floor 9 Posted 2007-07-04 21:42 ·  中国 上海 浦东新区 电信
初级用户
Credits 108
Posts 49
Joined 2007-03-09 06:08
19-year member
UID 81161
Gender Male
Status Offline
It seems relatively troublesome...
I do have a lot of SOURCE CODE that can run under DOS. But it's not easy to sort them out.

I think, I need some things about USB in DOS.
Need to understand the software aspects of the specifications of OHCI, UHCI and EHCI.
Floor 10 Posted 2010-12-23 14:24 ·  中国 北京 联通
新手上路
Credits 2
Posts 1
Joined 2010-12-16 10:23
15-year member
UID 179350
Gender Male
Status Offline
Learning
Forum Jump: