How does the ACM chip on the USB controller work?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
austanss
Member
Member
Posts: 377
Joined: Sun Oct 11, 2020 9:46 pm
Location: United States

How does the ACM chip on the USB controller work?

Post by austanss »

I'm interested in creating a method of real-hardware testing with my OS. If I encounter errors, I can check serial monitor when virtualizing. When testing on real hardware, although I do have an RS-232 port, I do not have a method of monitoring it. Yet, I have an Arduino that uses ACM to communicate over serial. I programmed it to act as a serial loopback cache. It works.

I am wondering how the ACM chip on the USB controller works.

Mainly, how it maps to a virtual serial port.

Does it a) map directly to a serial port that you can simply outb to, or b) wait on the USB controller to be configured, requiring a USB driver?

There is a very sparse amount of information on ACM, I hope someone here knows a thing or two.

I am willing to write a USB driver, may it be necessary.
Skylight: https://github.com/austanss/skylight

I make stupid mistakes and my vision is terrible. Not a good combination.

NOTE: Never respond to my posts with "it's too hard".
User avatar
austanss
Member
Member
Posts: 377
Joined: Sun Oct 11, 2020 9:46 pm
Location: United States

Re: How does the ACM chip on the USB controller work?

Post by austanss »

I can't find hardly any information on ACM and writing a driver on the whole of the Internet.
Skylight: https://github.com/austanss/skylight

I make stupid mistakes and my vision is terrible. Not a good combination.

NOTE: Never respond to my posts with "it's too hard".
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: How does the ACM chip on the USB controller work?

Post by iansjack »

If it's a USB device then you are going to have to write a USB driver. It would probably be easier to write the basic driver, getting it to work with keyboards, mice, and storage devices first. Then you can look into the particulars of your UART.
User avatar
austanss
Member
Member
Posts: 377
Joined: Sun Oct 11, 2020 9:46 pm
Location: United States

Re: How does the ACM chip on the USB controller work?

Post by austanss »

There is virtually no information on ACM on the whole of the internet.
Skylight: https://github.com/austanss/skylight

I make stupid mistakes and my vision is terrible. Not a good combination.

NOTE: Never respond to my posts with "it's too hard".
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: How does the ACM chip on the USB controller work?

Post by iansjack »

This Linux ACM driver might give you some ideas: https://gitlab.docice.network/NextThing ... sb/acm.txt
User avatar
austanss
Member
Member
Posts: 377
Joined: Sun Oct 11, 2020 9:46 pm
Location: United States

Re: How does the ACM chip on the USB controller work?

Post by austanss »

iansjack wrote:This Linux ACM driver might give you some ideas: https://gitlab.docice.network/NextThing ... sb/acm.txt
I obtained the oldest Linux kernel source with ACM to minimize bloat (v2.5.0)
Skylight: https://github.com/austanss/skylight

I make stupid mistakes and my vision is terrible. Not a good combination.

NOTE: Never respond to my posts with "it's too hard".
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: How does the ACM chip on the USB controller work?

Post by Octocontrabass »

The USB ACM specification is here (in PSTN120.pdf). That document doesn't cover the USB host controller, which you need to write a driver for before you can write the ACM driver.
rdos
Member
Member
Posts: 3297
Joined: Wed Oct 01, 2008 1:55 pm

Re: How does the ACM chip on the USB controller work?

Post by rdos »

iansjack wrote:If it's a USB device then you are going to have to write a USB driver. It would probably be easier to write the basic driver, getting it to work with keyboards, mice, and storage devices first. Then you can look into the particulars of your UART.
Actually, keyboards & mice are extremely complicated (HID protocol) unless you use the boot protocol, which most mainstream OSes will not use since it is too limited. For USB discs, there is information lacking on how the transport layer works (behind pay-walls), and so those are complicated too. I think the CDC driver is a lot less complex, and everything is documented in the USB standard. Another possibility if you want a USB serial driver is to use FTDI based converts (practically all commercial products are based on FTDIs protocol). The FTDI protocol is rather simple too.
User avatar
eekee
Member
Member
Posts: 891
Joined: Mon May 22, 2017 5:56 am
Location: Kerbin
Discord: eekee
Contact:

Re: How does the ACM chip on the USB controller work?

Post by eekee »

rizxt wrote:When testing on real hardware, although I do have an RS-232 port, I do not have a method of monitoring it.
Any old laptop with with a docking station (or base) should do, running FreeDOS, Linux, 9front... pretty-much anything. I guess some of the newer docking stations might not have RS-232. Alternatively, old laptop plus a USB-serial dongle, but depending on the dongle's chipset you might need Linux or a commercial OS. You'll also want a "null modem" cable - it has some wires exchanged between the ends.

@OCB: Thanks for the link
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
Post Reply