# is it possible to run spinrite natively?



## jhatfield (Dec 3, 2003)

Is there any way to run SpinRite on a tivo WITHOUT removing the drive? By that I'm mean run it natively ON the tivo. It's a hassle to pull the drive and run it attached to another computer. I'm thinking the answer is almost certainly no given that SpinRite is written for PC hardware, but I just wanted to throw it out there in case anyone had come up with anything.

thanks,
Jon


----------



## Spire (Jun 6, 2001)

Not unless you want to write an x86 emulator that runs on the TiVo platform.

In other words: No, it isn't possible.


----------



## Da Goon (Oct 22, 2006)

You can run anything natively if you can find a mips or ppc build that's built for your hardware or if you can get ahold of the source code and compile it yourself. Good luck getting source code to SpinRite though.


----------



## Worf (Sep 15, 2000)

Problem is, the spinrite source code is in x86 assembly - it's not portable anyhow. (It's also highly dependent on the PC BIOS to do some work - and only the PC has the strange functionality provided by the BIOS).


----------



## jhatfield (Dec 3, 2003)

"Problem is, the spinrite source code is in x86 assembly..."

You know, I've heard Gibson talk about that many times on his podcast, and I just have to shake my head every time. That's just nuts. There are very good reasons NOT to write in assembly. The first of which is that it takes 10 times as long, or longer. You can write really tight, efficient, and small programs just fine with C or even C++.

Well, I didn't really expect it to be possible, but I'm tired of pulling drives, and I thought I'd ask. Thanks guys. Jon


----------



## Worf (Sep 15, 2000)

People are free to write whatever they want in whatever language they want.

A lot of Windows applications are written using MFC, or the current craze, .NET. However, I write my Windows apps using straight C, calling the Win32 API directly. Nothing wrong with that, and it takes me way longer to write an app that someone else using .NET would, but for what I do, it's good enough. (And I cheat further by writing console apps and avoiding GUI as much as possible.)

Writing in assembly should be essential to understand "what the compiler" does. Some apps just are implemented so stupidly...

Anyhow, given that much of Spinrite has to be done in assembly anyhow (access to BIOS / drive registers / the multithreading kernel / etc), I guess the extra overhead of the application level code is minor considering how much had to be written already.


----------



## jhatfield (Dec 3, 2003)

Worf said:


> Writing in assembly should be essential to understand "what the compiler" does.
> 
> Anyhow, given that much of Spinrite has to be done in assembly anyhow (access to BIOS / drive registers / the multithreading kernel / etc),...


Well sure, but we're not all computer scientists/students.

I haven't yet studied anything the HAD to be written in assembly. That's what compilers are for. In that respect, you could say that everything is written in assembly (by the compiler). But if something did need to be written directly in assembly, say if it had to be super efficient, you could always call bits of assembly from C.


----------



## Worf (Sep 15, 2000)

That's what I find the problem with programmers. They don't learn how the compiler works, and they just implement some piece of crap that works, but really could be done in a better way if someone actually sat down and thought through how the machine works. Or how some API calls are "expensive" and thus, should be made as infrequently as possible. 

Sometimes understanding what goes on underneath the hood can make one a much better programmer. 

Hell, even an understanding of complexity would make better programmers. (This coming from someone whose seen a GUI widget go slower and slower and slower and consume more CPU power until updating the widget meant a high-end PC was locked for minutes - the problem being the widget was coded badly and spending time inside memcpy()...)


----------



## jhatfield (Dec 3, 2003)

Worf said:


> That's what I find the problem with programmers. They don't learn how the compiler works, and they just implement some piece of crap that works, but really could be done in a better way if someone actually sat down and thought through how the machine works. Or how some API calls are "expensive" and thus, should be made as infrequently as possible.


That's because a lot of programmers don't have degrees in Computer Science . I'm learning so much about compilers right now I'm sick of it already. It's tedious. I'm just hoping I don't have to build a working compiler before I graduate, but it's a possibility.

Now, from a business perspective in a production environment, it can be more important just to get the software out the door. It's not good computer science, but as long as it works, Moore's law will take care of the "bloat". One could point to a certain giant operating system company as a prime example. Everyone complains about their products, but how much is the company worth again?


----------

