LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-22-2008, 08:22 AM   #16
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50

Quote:
Originally Posted by leedude View Post
and the homebrew computer:
Maybe i should use an ARM...or an 8086...or a z80...or my own design with an FPGA...or even with TTL chips like that magic-1 cpu.
Wow - so many choices. Hmm. ARM will at least force you to learn techniques of cross-compiling and 'remote' debugging. There are actually CPUs implemented in FPGA - including the venerable PDP-11 (won't that mosnter ever die). There are also "System on Chip" devices which you can buy - CPU core + FPGA. And don't write your own floating point arithmetic for, say, the ARM - too easy to make mistakes and other people have already spent huge amounts of time doing that. Sure you can do it for fun - but you may as well do a proper job then and verify that your calculations all behave as expected by the appropriate IEEE standard for FPUs, including the ability to change the roundoff technique.

Just keep the project small - pick any CPU or board. ARM gives you some working space because it has rather vast resources compared to something like the Rabbit4000 (something like max program memory 512K + 512K RAM). Start out with small targets and build up. If you bite off too much at once, you'll just get too frustrated because it will be many months before you see anything work.
 
Old 07-22-2008, 08:25 AM   #17
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Quote:
Originally Posted by resetreset View Post
Because he wants to. How ironic! It's the very thought that created Linux in the first place, and probably what people told linus torvalds when he had it.
The world was different then. We were talking about a 386 as most sophisticated hardware, but nevertheless a full powered CPU which included a MMU and protected mode. On the other hand, most of those 386-es were still running DOS or Windows 3.0. There was need for a x86 real OS.
I also said that if the OP has to support dedicated hardware like 8051 or so, writing an OS might be viable. When I was still working as a programmer we used our own OS on 8051, 680x0 and 68HC11 embedded systems. It was a real pre-emptive multitasking RTOS, but it lacked multi-user capabilities (there were no users) and memory management (no disk to page to anyway).

Quote:
Originally Posted by resetreset View Post
But I do wish that what we know of today as "free", "hackerly" and "open source" wasn't a reimplementation, and one of a corporate product, that too 30 years old.
Interesting statement. Why? Something with a very healthy fundamental cannot be beat, despite of the high degree of workmanship you need to work with it in depth. A comparison. In furniture making, we nowadays revert mainly to plywood or particleboard covered with veneer or plastic. It is glued together with dowels, biscuits or simple butt joints. Or screws are used. You can afford that because the glue quality today is such that everything is held together (more or less), or the price of the screws has become so cheap that you can use them in your product. However, such cabinets tend to fall apart after a few years of use.
Compare this with classical woodworking, dovetails, mortise and tenon joints etc. It takes a lot of effort to build, and a ton of workmanship. The construction is such that glue is just needed to keep the parts in place, but the strenght comes form the joinery. Also screws are seldomly use as in ancient times they were too expensive. Those techniques are over 2 centuries old, but are still superiour over modern particleboard design. Just not commercially feasible. You never have to worry that such a cabinet falls apart though.

That a technique is ancient doesn't mean it cannot be superiour.

It might be easy to draw a parallel between GUI OS with smashing graphics, visual effects and whatnot, ineffecient design because there is plenty of processor power, built on a weak fundamental on one side. And a highly efficient command line based OS on a sound fundamental, designed right from the bottom up, each instruction tweaked for maximum efficiency.

If you doubt the fitness of the Unix OS, compare it with its competitors of that time. OS360, MVS, VMS, RT11 etc. It is not for nothing that Unix survived, I think until today, while others became extinct. It is not what I say, it is history.

If Linux is a clone of Unix (which is actually how it started), even better. There is a saying in Dutch, I hope the translation make sense: "Better stolen shrewdly than designed badly" (Can some native English speaker who understands please this word it in a proper way - regardless whether or not you agree)

jlinkels
 
Old 07-22-2008, 09:39 AM   #18
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
the bios is written in 16 bit code. i dont think you can use that in 32 bit. i *still* after all that time cant give you a clear reply, but i think when the cpu switches to protected mode, it simply disappears from memory space. if you find any clear info about this, plese post here.
 
Old 07-22-2008, 09:43 AM   #19
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
Quote:
Originally Posted by jlinkels View Post
If you doubt the fitness of the Unix OS,
I wasnt necessarily saying Unix is bad, I think Reimplementation is unhackerly.
 
Old 07-22-2008, 10:58 AM   #20
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by resetreset View Post
the bios is written in 16 bit code.
i dont think you can use that in 32 bit.
Why? CPUs are backward compatible. On 32bit you still have access to AX/BX/CX/etc (which you can use) with all 16bit calls, although you also will be able to use EAX/EBC/ECX/etc. You can use 16bit code in 32bit, but there might be problem with the memory access in protected mode - if interrupt assume segment+offset addressing and load segment registers directly, then it might not work.

Quote:
Originally Posted by resetreset View Post
i *still* after all that time cant give you a clear reply, but i think when the cpu switches to protected mode, it simply disappears from memory space. if you find any clear info about this, plese post here.
Why should it disappear? See here. Bios should be perfectly readable as log as you have right address and privilegies.

As for calling disk interrupts fron win95/98 it looks like Win98 uses DeviceIOControl() which simulates interrupt used in MS-DOS. Anyway I could swear I saw a listing calling interrupts directly on windows 98/95, though, but I can't find that example now, and don't have access to win98/95 now (this won't work on Win NT ant above) to check if calling interrupts directly works or not.
Also check this:
1) http://www.monstersoft.com/tutorial1/PM_intro.html
Quote:
16-bit Protected Mode
16-bit Protected Mode is (AFAIK) exclusive to Borland Pascal 7.0. The segment limits are set to 64K and the compiler will only do 16-bit addressing. Most BIOS interrupts work, but some special care has to be taken in order to do some real-mode specific things. Any BIOS interrupt that accepts values in segment registers has to be called with a Real-Mode callback. This is the easiest protected-mode to program for since very few modifications have to be made for 16-bit RM programs (making for easy ports of applications). Pointers are usually 32-bits, 16-bit selector and 16-bit offset. The most memory that can be allocated is 16 megabytes.
32-bit Protected Mode
32-bit protected mode is almost a standard now with C and C++ compilers. Watcom C, GNU C and Borland C are all now 32-bit compilers. For the most part the segment registers are set to the base of memory and only the 32-bit offset is used. Therefore, pointers are 32-bits. Programming in 32-bit PM is very difficult, as most of the BIOS calls don't work directly (a real-mode callback must be used). The most memory addressable is 4 gigabytes.
2) http://www.monstersoft.com/tutorial1/VESA_info.html
3) http://en.wikipedia.org/wiki/Protect...workarounds-20

To me it looks like interrupts are available in 16bit protected mode, and problem arise in 32bit protected mode because of addressing differences.

Last edited by ErV; 07-22-2008 at 11:15 AM.
 
Old 07-22-2008, 11:11 AM   #21
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by resetreset View Post
I wasnt necessarily saying Unix is bad, I think Reimplementation is unhackerly.
Not grasping your point here......I infer that you mean that building Linux based on Unix is somehow impure. If that's what you mean, then I see it quite differently. Very often, the old ways turn out to be best. In the case of Unix, I think it has endured longer than any other OS. There must be a reason.

Sometimes the very best engineering is a small improvement on an existing technology. And some of the WORST engineering comes from people who can't or won't look at existing solutions.
 
Old 07-23-2008, 05:22 AM   #22
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
Quote:
Originally Posted by pixellany View Post
impure.


Uncreative.


If that's what you mean, then I see it quite differently. Very often, the old ways turn out to be best. In the case of Unix, I think it has endured longer than any other OS. There must be a reason.

If something took off and lots of vital software was available for it, that would be a reason for it to last because you simply *couldn't* switch to anything else.
How long has Windows endured? How long did we endure Windows when uninstalling a program meant it took half of the system with it, and it crashed every two seconds, right until XP? What was the reason people kept using it despite Linux being very much available, better and free?

The 386 was DESIGNED and made to run Unix - it's so interesting that *hardware* can be designed for software and not the other way around. *Windows* happened by accident. What's happening now with Linux is kind of what was deigned all along.
 
Old 07-23-2008, 09:47 AM   #23
leedude
Member
 
Registered: Jan 2007
Location: Scotland
Distribution: Fedora, Debian
Posts: 81

Original Poster
Rep: Reputation: 15
Quote:
If something took off and lots of vital software was available for it, that would be a reason for it to last because you simply *couldn't* switch to anything else.
How long has Windows endured? How long did we endure Windows when uninstalling a program meant it took half of the system with it, and it crashed every two seconds, right until XP? What was the reason people kept using it despite Linux being very much available, better and free?
Exactly my thoughts

im not saying linux/unix is no good. i use it a lot more than any other OS but i dont think it is the 'be all end all' of computing.

maybe it would even be worth slimming everything down, and thinking about alternatives to the personal computer (the do-everything machine) as useful as it is:
http://en.wikipedia.org/wiki/Ubiquitous_computing

maybe some kind of floating point unit interfaced directly to the brain would be a step in the right direction(or toward corruption, depends how you think about it).

im pretty sure I would volunteer for implantation of a short range passive RFID(like they have in pets)given the chance, so i could open doors and stuff.

EDIT: on second thought i probably wouldn't.

Last edited by leedude; 07-23-2008 at 12:58 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
grip : no write access to write encoded file bidouilleur Linux - Software 5 10-09-2010 09:23 PM
Find users how read/write/delete in a directory aclica Linux - Newbie 4 11-14-2007 06:41 AM
Why can I not write to a SAMBA share when read/write is enabled? eric m Linux - General 4 08-21-2006 09:22 PM
find a string and write it somewhere eicherlist Programming 11 01-02-2004 10:07 AM
Does Linux write what happens at boot to a file ? I can't find anything in var/log . lostboy Linux - General 8 05-07-2003 02:58 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration