OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 8:38 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: tatOS and USB
PostPosted: Fri Feb 26, 2016 11:47 am 
Offline
Member
Member

Joined: Sat Mar 15, 2008 7:20 am
Posts: 42
Location: Wisconsin, USA
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


Top
 Profile  
 
 Post subject: Re: tatOS and USB
PostPosted: Fri Feb 26, 2016 3:40 pm 
Offline
Member
Member
User avatar

Joined: Mon Mar 05, 2012 11:23 am
Posts: 616
Location: Germany
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

_________________
Ghost OS - GitHub


Top
 Profile  
 
 Post subject: Re: tatOS and USB
PostPosted: Fri Feb 26, 2016 8:09 pm 
Offline
Member
Member
User avatar

Joined: Sun Sep 19, 2010 10:05 pm
Posts: 1074
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


Top
 Profile  
 
 Post subject: Re: tatOS and USB
PostPosted: Sat Feb 27, 2016 10:30 am 
Offline
Member
Member
User avatar

Joined: Mon Jun 16, 2014 5:59 am
Posts: 543
Location: Shahpur, Layyah, Pakistan
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.

Top
 Profile  
 
 Post subject: Re: tatOS and USB
PostPosted: Sat Feb 27, 2016 10:33 am 
Offline
Member
Member

Joined: Sat Mar 15, 2008 7:20 am
Posts: 42
Location: Wisconsin, USA
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


Top
 Profile  
 
 Post subject: Re: tatOS and USB
PostPosted: Sat Feb 27, 2016 4:03 pm 
Offline
Member
Member

Joined: Sat Mar 15, 2008 7:20 am
Posts: 42
Location: Wisconsin, USA
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


Top
 Profile  
 
 Post subject: Re: tatOS and USB
PostPosted: Sat Feb 27, 2016 5:02 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
But why do you want to run with a misaligned stack? What's the point when you can so easily just do it correctly?


Top
 Profile  
 
 Post subject: Re: tatOS and USB
PostPosted: Sat Feb 27, 2016 6:12 pm 
Offline
Member
Member
User avatar

Joined: Sun Sep 19, 2010 10:05 pm
Posts: 1074
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


Top
 Profile  
 
 Post subject: Re: tatOS and USB
PostPosted: Sun Feb 28, 2016 5:32 am 
Offline
Member
Member

Joined: Wed Jun 17, 2015 9:40 am
Posts: 501
Location: Athens, Greece
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


Top
 Profile  
 
 Post subject: Re: tatOS and USB
PostPosted: Sun Feb 28, 2016 6:34 am 
Offline
Member
Member

Joined: Wed Jun 03, 2015 5:03 am
Posts: 397
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 :)


Top
 Profile  
 
 Post subject: Re: tatOS and USB
PostPosted: Sun Feb 28, 2016 7:37 am 
Offline
Member
Member

Joined: Sat Mar 15, 2008 7:20 am
Posts: 42
Location: Wisconsin, USA
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 36 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group