Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
The simple stack machine would work on it - just by compiling for it.
It would make using a shared memory (stack segment and data segment), though it would likely be nice to have more than a 16 bit limit. Will think on it.
One fun thought would be a 1/2/3 byte operand allowing for 1 or 2 bytes for offsets, and 3 for for offset or memory address (still use 4 bytes for constants). Currently it does 1/2/4, with 2 used for memory address, and 4 bytes for some constants.
Will look at using 4 byte offsets for stack alignment, but with byte addressing via indexing by non-stack pointer. This would allow the greatest ease with sharing addressing between stack and data. Would also need a block transfer for large data copying (wanted that anyway).
The M machine is 16/32 bit - you probably would want to use the 32 bit only machines. They are faster and made for a general computing environment. I think their original machine was a 6502 variant (apple II/ commodore 64) and the 6502 was a nice A/Q machine of very early make. I like the ARM instruction set. I think I will stick with the PIC32. Maybe at some later date try out the ARM once I get established. The IDE is from KIEL and costs money. Microchip's IDE is free and works with Linux.
The ARM IDE could be Linux itself - it runs on nearly all of the chips except the very lowest. Look at the Raspberry PI for an example. The entire system is about $45 (the credit card sized board includes video, ethernet, IO pins to daughter cards, and two USB ports). What brings it up to about $90 is buying other things like power bricks, cables, keyboards/mouse... And comes in two versions: 256MB or 512MB.
As to the 16/32 bit operation, that is up to the compiler (GCC compiles for Cortex-M0/M0+/M3/M4/A9)
The main advantage though is the memory access. Having the data/stack share addressing makes a lot of coding easier, and with a simpler run time.
I have gotten the debug parse tree walker working again. Next step is to get code generated again. Features for local variables (and even data structures) is also in place, though not used yet.
Once code is generated again, I'll start revisiting the interpreter... I will definitely be re-arranging
the instruction coding, adding a memory copy, and possibly making the stack byte addressable. Whether it gets a larger range or not. It might - I have figured out a memory encoding using 3 byte addresses. The high order two bits would identify the segment (instruction, constants, stack, and variable)
Spent the first half of the day debugging errors and warnings. Then I found that I had two different string data structures with the more advanced one not fully implemented. Had to look through 3588 lines of c and a large header file to fully implement the advanced data structure. Had to take an elderly lady to a wake and just finished in time to drop it until monday. Still think you should write a book on your stack machine, assembler and compiler. A way to monetize your work.
Got the updated translator working yesterday. a blinding flash of the obvious after looking for it for days... two bugs, with overlapping symptoms. Now to add the array indexing (and document the errors for next time...)
Double errors were always the hardest to find when working in the VPI&SU computing center years ago.
They always are the most aggravating.
The worst one I ever ran across was a hardware bug - We had a display with a stylized diagram of a ship - a pointed bow, rectangular sides, and a rounded stern. Oriented based on GPS position and direction (as computed by our navigation system). Took us a while to get antenna offsets computed right, Compass rotations filtered properly, and showing updates in real time.
A day or so later one of the team goes "Thats odd...", so we watched the display - no problem. "Well what?"... "Keep watching...".. Then, roughly once every 10 or 15 seconds the stern would bend into the center of the ship... Almost like a collision from the rear...
Days later... we added one NOOP between every instruction where the computation had to be going wrong... and it didn't happen. So we took one no-op out at a time, for an entire day. We determined it was a hardware fault when the error would only occur when we took the last NOOP out - which was between a floating divide and a floating store of the register just used in the divide.
It never happened anywhere else that we could detect - just that specific 10-12 instructions, in that specific order, with the divide/store being the last two instructions. Sometimes the store would not get the result of the divide, and get zero.
Program getting big. Looked for an option of gcc that would print out the function definition and line number. Ended up writing a state machine with some special comments in the c source I was analyzing to do it myself. Next have to alphabetize it. Plan to reduce it to just line number with function name alphabetized. Reduced 3588 lines of code down to three pages of information. Lets me work offline with a printout which for some reason makes me feel calmer about the debugging process. Programming is a very emotional process. For me at least each new error or problem makes me feel defeated and somewhat afraid. I think it is due to my brain chemical problems and anxiety. My defense mechanism has always been to push through even with those feelings. May be revealing too much of myself in this public forum.
Not to worry too much. I sometimes have concentration issues - occasionally what used to take 15 minutes now can take hours (depending on the bug). It can cause headaches - which I break by playing some game or other.
One way to learn C is to write an interpreter. I am finding out everything I don't know about C. Somewhat humbling. But it is also fun in a strange way. Just got a post from a friend who is into RC gliders. I think I will build the plane I have sitting around. A good winter project. That is fun too.