Author Topic: Usb storage source code.  (Read 15651 times)

Offline Leekyungyeol

  • Jr. Member
  • *
  • Posts: 3
Usb storage source code.
« on: May 08, 2010, 08:38:33 AM »
How can I make code about usb storage?

It is very difficult to me.

I wan source code to read and write to usb storage.

If anybody refly to me, I will thanks very much.
« Last Edit: May 08, 2010, 08:41:04 AM by Leekyungyeol »

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Usb storage source code.
« Reply #1 on: May 08, 2010, 04:04:10 PM »
What "environment" are you in, Leekyungyeol? In Linux, we could "sys_open", "sys_read", "sys_write"... same as to any other file... as far as I know. I ASSume it's similar for Windows(?). If you need to do this without support from some OS - from a bootsector, say... I've been told that you do *not* want to attempt to write a "usb stack"(???) in asm. (not saying I believe it, but that's what I've been told)

I don't have much experience with usb. I plugged a camera into a usb port once - "sys_open"ed it and the LED came on (much farther than I ever got with a camera plugged into the parallel port!!!). I "sys_read" from it and got some data. Never got as far as converting it into an image... got distracted...

One of my housemates has gone out of town, and left behind (among other things) a couple of "pen drives". I might "borrow" one to experiment with. Is that the type of usb device you're interested in? (I guess the "u" in "usb" is for "universal", so I guess we might be dealing with a lot of different devices... consistant interface? We'll find out, I guess...)

What have you tried that you found "difficult"? How "raw" do you need it?

Best,
Frank


Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Usb storage source code.
« Reply #2 on: May 09, 2010, 02:33:50 PM »
I came across this:

http://www.asmcommunity.net/board/index.php?topic=29664.0

Which refers to this:

http://www.usb.org/developers/docs/

Pray you don't need it!

Best,
Frank


Offline Leekyungyeol

  • Jr. Member
  • *
  • Posts: 3
Re: Usb storage source code.
« Reply #3 on: May 09, 2010, 03:27:34 PM »
Thanks Frank.

And I'm sorry about my late reply.

I said Universial Serial Bus.

And a USB flash memory.

I try to operate it without any OS. For example bootsector.

I could read or write to it with bios interrut service. (It is INT 0x13)

But I tried to move from real 16bit mode to protect 32bit mode.

I could't operate it on protect mode.

So I need source code without any OS.(I want to make OS on USB storage.)

And I'm student. I will use it to graduation work.

I'll look carefully your links.

Thanks again.
(P.S I don't speak English well. So a reply is not easy to me. But I love nasm. ^^;)
« Last Edit: May 11, 2010, 02:34:42 AM by Leekyungyeol »

Offline Keith Kanios

  • Full Member
  • **
  • Posts: 383
  • Country: us
    • Personal Homepage
Re: Usb storage source code.
« Reply #4 on: May 11, 2010, 01:15:58 AM »
-----> USB @ OSDev.org <-----

Offline Leekyungyeol

  • Jr. Member
  • *
  • Posts: 3
Re: Usb storage source code.
« Reply #5 on: May 11, 2010, 02:18:26 AM »

Thanks Keith.
« Last Edit: May 11, 2010, 02:20:33 AM by Leekyungyeol »