Page 1 of 1
tatOS and USB
Posted: Fri Feb 26, 2016 11:47 am
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
Re: tatOS and USB
Posted: Fri Feb 26, 2016 3:40 pm
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?
Greets
Re: tatOS and USB
Posted: Fri Feb 26, 2016 8:09 pm
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.
Re: tatOS and USB
Posted: Sat Feb 27, 2016 10:30 am
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/.
Re: tatOS and USB
Posted: Sat Feb 27, 2016 10:33 am
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
Re: tatOS and USB
Posted: Sat Feb 27, 2016 4:03 pm
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
Re: tatOS and USB
Posted: Sat Feb 27, 2016 5:02 pm
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?
Re: tatOS and USB
Posted: Sat Feb 27, 2016 6:12 pm
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.
Re: tatOS and USB
Posted: Sun Feb 28, 2016 5:32 am
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!
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
Re: tatOS and USB
Posted: Sun Feb 28, 2016 6:34 am
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.
Re: tatOS and USB
Posted: Sun Feb 28, 2016 7:37 am
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