tatOS and USB

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
Post Reply
TomT
Member
Member
Posts: 42
Joined: Sat Mar 15, 2008 7:20 am
Location: Wisconsin, USA
Contact:

tatOS and USB

Post by TomT »

Well I have uploaded a new copy of tatOS to github.

This little hobby OS now has a usb keyboard driver along with the usb mouse and flash drive.

The supported USB controllers are:
* UHCI usb 1.0
* EHCI usb 2.0 with UHCI companion controllers
* EHCI with integrated root hub (rate matching hub)

tatOS may be a useful study for developers eager to develop their own drivers for USB.

Thanks for trying tatOS.

TomT
https://github.com/tatimmer/tatOS
User avatar
max
Member
Member
Posts: 616
Joined: Mon Mar 05, 2012 11:23 am
Libera.chat IRC: maxdev
Location: Germany
Contact:

Re: tatOS and USB

Post by max »

TomT wrote:Well I have uploaded a new copy of tatOS to github.

This little hobby OS now has a usb keyboard driver along with the usb mouse and flash drive.

The supported USB controllers are:
* UHCI usb 1.0
* EHCI usb 2.0 with UHCI companion controllers
* EHCI with integrated root hub (rate matching hub)

tatOS may be a useful study for developers eager to develop their own drivers for USB.

Thanks for trying tatOS.

TomT
https://github.com/tatimmer/tatOS
Hey TomT,

nice work! :) Do you have some prebuilt images to try it out? And, how does "doc/faith" relate to the OS? :mrgreen:

Greets
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: tatOS and USB

Post by SpyderTL »

Haven't tried it yet, but boot1.s mov sp, 0xffff should be mov sp, 0x0000.

Just trust me. :)

EDIT: Tried out the floppy image when I got home, and I'm genuinely impressed. I like the graphics mode, and the look and feel, and the menus are simple and navigable. The whole system seems pleasantly stable.

I had VirtualBox set up with and OHCI USB controller, and ran the UHCI initialization, and it still seemed to work, so I'm not sure what's actually going on there.

But overall, nice work! Keep at it, and let us know when new features are added and are ready to use.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
User avatar
Muazzam
Member
Member
Posts: 543
Joined: Mon Jun 16, 2014 5:59 am
Location: Shahpur, Layyah, Pakistan

Re: tatOS and USB

Post by Muazzam »

https://github.com/tatimmer/tatOS/blob/master/doc/faith

It's my favorite part. It's always a pleasure to see a religious person, especially an Abrahamic religion follower. I love Jesus too; you're not alone. Keep it up!

I liked the detail in /doc/.
Last edited by Muazzam on Sat Feb 27, 2016 10:33 am, edited 1 time in total.
TomT
Member
Member
Posts: 42
Joined: Sat Mar 15, 2008 7:20 am
Location: Wisconsin, USA
Contact:

Re: tatOS and USB

Post by TomT »

Hello Max,

tatOS.img is a prebuilt image for USBCONTROLLERTYPE == 2 (see tatOS.config)

Technically doc/faith has nothing to do with assembly language programming and OS development, but then again, it is a big part of who I am.

Spyder, thanks for your feedback.

TomT
TomT
Member
Member
Posts: 42
Joined: Sat Mar 15, 2008 7:20 am
Location: Wisconsin, USA
Contact:

Re: tatOS and USB

Post by TomT »

Spyder,

By suggesting to set sp=0 you are talking about stack alignment/misalignment ?
At sp=0, one WORD push will decrement sp to 0xfffe keeping it WORD aligned.
How serious is my error ?
I have been running the real mode stack this way for quite some time with no noticeable performance issue.

Thanks,

TomT
User avatar
iansjack
Member
Member
Posts: 4686
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: tatOS and USB

Post by iansjack »

But why do you want to run with a misaligned stack? What's the point when you can so easily just do it correctly?
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: tatOS and USB

Post by SpyderTL »

Plus you are wasting one byte of stack memory. :)

Setting SP to 0xFFFF is just one of those things that seems correct, at first, until you think about it. Just tryin to help. :)
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
glauxosdever
Member
Member
Posts: 501
Joined: Wed Jun 17, 2015 9:40 am
Libera.chat IRC: glauxosdever
Location: Athens, Greece

Re: tatOS and USB

Post by glauxosdever »

Hi,


TomT, I like that you are still improving your USB code. I based my USB implementation on it. I also like the way it's documented. Good work! =D>

But, no offense, setting SP=0xFFFF is one of the mistakes that happen when writing your own bootloader (reference to the wiki). Even if it worked for all of this time, it's no good.


Regards,
glauxosdever
embryo2
Member
Member
Posts: 397
Joined: Wed Jun 03, 2015 5:03 am

Re: tatOS and USB

Post by embryo2 »

TomT wrote:At sp=0, one WORD push will decrement sp to 0xfffe keeping it WORD aligned.
How serious is my error ?
For some stack-intensive tasks it can slow system for roughly 25%. But such tasks are not very common, so you can keep the thing unchanged.

But it's as serious as any inefficiency you allow your OS to have. Your OS can do something relatively quickly, but when you approach a serious goal it can slow and keep you from reaching your goal.

And there's another possibility - you won't ever notice anything bad for the whole your life. The latter is happen very often. But the former can hurt a lot after you realize that now it is required to rewrite your OS from scratch because of a lot of inefficiencies here and there.
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability :)
TomT
Member
Member
Posts: 42
Joined: Sat Mar 15, 2008 7:20 am
Location: Wisconsin, USA
Contact:

Re: tatOS and USB

Post by TomT »

Thank you all for your comments about stack alignment.
I will fix that.
Back in 2009 when I wrote that code, I was a very green OS developer and did not make a conscience decision to misalign the stack but now that you have pointed this out, with potential pit falls, "I see the light".
Thanks
TomT
Post Reply