I made it to the floating point math chapter in my book and discovered that ebe was showing 0's for the xmm registers and wouldn't display the ymm registers. I checked and a program which loaded 3.25 into xmm0 ended up with xmm0.v4_float = {0.0, 0.0, 0.0, 3.25} while the same program under Linux shows it as {3.25, 0.0, 0.0, 0.0}. I don't think the CPU has an option for reversing the order of the floating point values in the xmm registers.
I checked the version for gdb and found that I was using 6.3 under OS X and 7.5 under Linux, so I checked MacPorts and 7.5 is available, so I installed it. Then the fun began. It must be codesigned which requires greating a code signed certificate. I have done that and signed it still fails to run with this message when I try the run command on a program:
Unable to find Mach task port for process-id 58919: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
The more I poke at OS X the less I like it. Installing gdb is trivial under Linux. Is there some extra permission involved with Linux? I doubt it, but at least it just works.
Just for grins I did "sudo gdb fpadd" and it now lets the program run, though I get a slew of BFD unknown load command errors.
I will return to this later when I know more.
Well, 1 day later and no closer to understanding this nonsense. I have managed to run gdb 7.5 which solves the problem with the xmm register values being reversed. I still have problems running gdb as seyfarth instead of root. I tried installing a newer version of gcc which does not help. For my test code I am linking with gcc so it seems possible that some linker options might result in an exe file which gdb recognizes as having a need for avx support.
I suppose I will get this solved, but will I end up with a clearly defined way for people to configure their own Macs to support floating point properly with ebe? I think I will refrain from entering a complete discussion in the book and refer to a web site so that I can adjust the description as I learn more.
After a couple more days of poking around I have reached a decision. I have implemented a xmm:reverse ini parameter which will allow someone who is using a "defective" gdb to see the xmm registers properly. I expect that in a few months OS X will have an easily installable gdb with proper xmm/ymm register support. I will point out that there is a problem with some versions of gdb in the book and suggest where to look on my web site for further information.
I did find a workable solution using the lldb debugger which comes with xcode. This would make ebe unnecessarily complex for a few months. There would be enough changes to make it likely that there would be additional bugs. I decided to exercise a little patience. No matter which choice I made I would have to document it in the book. Using the gdb which came with xcode makes it less trouble to use at the cost of setting a value in .ebe.ini.
Monday, November 05, 2012
Sunday, October 28, 2012
OS X Stupidity
Why did Apple choose to make X Windows an afterthought? They caused some grief with was not necessary.
UNIX systems have had a network based windowing system for about 30 years. This is extremely handy. For my needs this allows me to use ssh to connect to a Linux computer and run ebe over the network.
But this doesn't work if I use ssh to connect to my Mac. My ebe script succeeds in running xterm which is an X application, but the python tkinter windows never show up, because they are using the stupid OS X Windows (not X Windows).
Today I tried to find a good tool for doing screen captures for my book. The ImageMagick import tool works wonderfully well under Linux and it compiles under OS X, but it won't capture the stupid OS X Windows. I can capture xclock and the xterm window of ebe, but the main parts of ebe are off-limits.
I tried the xcreencapture program and it works fairly well, but it includes the title bar in the image. I don't want the title bar. Furthermore it has color which is not acceptable in a black and white book.
So I ask again: Why did Apple choose to make X Windows an afterthought? Is this designed to prevent users from being able to run apps on a Mac remotely? I suppose in order to sell MS Office on the Mac they had to guarantee that no one could run Office remotely. That might hurt sales.
Hey, Apple, there are other ways to force people to pay up for MS licenses. X Windows was a good idea 30 years ago and it is still a good idea today.
It looks like I may have to use a GUI tool to trim images. Perhaps I can use one of the ImageMagick tools to delete the titlebars.
Another problem which did not have to exist. Apple could have made this all so easy. I am sure it would have been easier for Apple to use X Windows than to invent their own substandard system.
UNIX systems have had a network based windowing system for about 30 years. This is extremely handy. For my needs this allows me to use ssh to connect to a Linux computer and run ebe over the network.
But this doesn't work if I use ssh to connect to my Mac. My ebe script succeeds in running xterm which is an X application, but the python tkinter windows never show up, because they are using the stupid OS X Windows (not X Windows).
Today I tried to find a good tool for doing screen captures for my book. The ImageMagick import tool works wonderfully well under Linux and it compiles under OS X, but it won't capture the stupid OS X Windows. I can capture xclock and the xterm window of ebe, but the main parts of ebe are off-limits.
I tried the xcreencapture program and it works fairly well, but it includes the title bar in the image. I don't want the title bar. Furthermore it has color which is not acceptable in a black and white book.
So I ask again: Why did Apple choose to make X Windows an afterthought? Is this designed to prevent users from being able to run apps on a Mac remotely? I suppose in order to sell MS Office on the Mac they had to guarantee that no one could run Office remotely. That might hurt sales.
Hey, Apple, there are other ways to force people to pay up for MS licenses. X Windows was a good idea 30 years ago and it is still a good idea today.
It looks like I may have to use a GUI tool to trim images. Perhaps I can use one of the ImageMagick tools to delete the titlebars.
Another problem which did not have to exist. Apple could have made this all so easy. I am sure it would have been easier for Apple to use X Windows than to invent their own substandard system.
Friday, September 28, 2012
Assembly Language: Linux vs OS X
I have had a Mac Mini computer for roughly a month and I have learned enough to do fairly well with 64 bit assembly language programming. Both Linux and OS X use the System V AMD64 Application Binary Interface which makes 64 bit assembly programming very similar between the two systems. By contrast Windows uses the Microsoft x64 ABI. Despite using the same ABI there are a couple of differences which make it difficult to write portable assembly language programs for Linux and OS X.
Naming conventions
Friday, September 14, 2012
Brand New Mac Mini
I have had my second Mac Mini for about a week now with none of the problems from the lemon Mini which was a refurbished machine. I have bought refurbished machines before which were quite useful. I had expected that my need for a Mac would be for several months while I prepared a Mac version of my assembly book. After that I could survive a failure.
In any case the new Mini is a keeper. I replaced the RAM with 2 8 GB SODIMMs the day after it arrived. It was pretty sluggish before with 4 GB, but runs pretty well with 16.
In any case the new Mini is a keeper. I replaced the RAM with 2 8 GB SODIMMs the day after it arrived. It was pretty sluggish before with 4 GB, but runs pretty well with 16.
Monday, September 03, 2012
Package tracking system
There should be more accurate package tracking systems for sites like UPS, FedEx, etc. Each package is already given an identifier. When a package is added to a container, the container would have an ID which would be used to track the package. When a package or container is placed in a truck then the truck's ID would be used to track the package or container. Similarly packages could be associated with planes or ships. At the vehicle level tracking could be done using a GPS system on the vehicle connected to the shipper's network.
With this system I could see that a package left Memphis 3 hours ago and was now passing through Yazoo City. With the current system packages frequently retain the same status for a day or more. I really doubt that many packages sit still for more than an hour or two here and there.
I wonder if someone already has a patent on this improved package tracking system?
With this system I could see that a package left Memphis 3 hours ago and was now passing through Yazoo City. With the current system packages frequently retain the same status for a day or more. I really doubt that many packages sit still for more than an hour or two here and there.
I wonder if someone already has a patent on this improved package tracking system?
Sunday, September 02, 2012
Returned the Mac Mini and Ordered a New One
On Friday the fourth day of Mini-time, I decided to try the Logitech driver for Mac OS X. I downloaded it and verified that the software knew which wireless mouse I had. Then I configured the mouse successfully. Within 5 minutes the Mini had crashed with the noise symptom. I contacted the seller using Amazon's return procedures and after a few messages, he approved the return. I had the computer in the mail on Saturday morning. The return authorization process was painless, though I would clearly have preferred that the Mini be a keeper.
After getting the authorization message I ordered a second Mac Mini, but this time I decided to go with a new computer rather than a refurbished one. I have had moderate success with refurbished HP computers before so I figured that a refurbished Mac would be at least as good as a refurbished HP. I am sure that there is some randomness involved and that generally a refurbished Mac would be successfully repaired, but this particular one seemed to be a lemon.
My new Mini will be a 2.4 GHz computer with 4 GB of RAM. I have also ordered 16 GB of RAM for the computer which should arrive at roughly the same time as the computer. An i5 computer with 16 GB of RAM should work quite well. I certainly hope that the new Mini works well with my KVM switch since it would allow me to switch computers while remaining in my chair. Getting up from one's chair is so 2000 and lame.
After getting the authorization message I ordered a second Mac Mini, but this time I decided to go with a new computer rather than a refurbished one. I have had moderate success with refurbished HP computers before so I figured that a refurbished Mac would be at least as good as a refurbished HP. I am sure that there is some randomness involved and that generally a refurbished Mac would be successfully repaired, but this particular one seemed to be a lemon.
My new Mini will be a 2.4 GHz computer with 4 GB of RAM. I have also ordered 16 GB of RAM for the computer which should arrive at roughly the same time as the computer. An i5 computer with 16 GB of RAM should work quite well. I certainly hope that the new Mini works well with my KVM switch since it would allow me to switch computers while remaining in my chair. Getting up from one's chair is so 2000 and lame.
Wednesday, August 29, 2012
First crash on the Mac mini
It happened on the second day of use. The computer arrived yesterday in the afternoon and crashed for the first time about 24 hours later.
I was surfing the Internet using google chrome while listening to musing with pandora. Suddenly there was a load non-constant booming noise from the external speakers. I tried to lower the volume using the mouse but the cursor would not move. The noise was very loud and I was afraid of damage to the speakers so I turned the volume very low on the speakers.
After a couple of minutes of trying to do something I gave up and pressed the power switch. This seemed to do nothing so I held the power button down long enough to power off. Then I restarted.
After rebooting I adjusted the speaker volume to be fairly low at the maximum setting on the computer. Perhaps if this lock-up happens again it will be less scary. I hope it doesn't happen while I am sleeping...
I am adjusting my initial score for the Mac mini:
Ubuntu Linux 10
Mac mini 7
Windows 7
Having a computer lockup so soon is unexpected. Since the Mac is all stock equipment selected by Apple, I had expected very high reliability. I figured that Mac OS X would have huge uptimes like Linux. Now I suspect that I have bought a lemon. I did buy a reconditioned computer, but I figured that Apple could isolate problems and repair a computer quite well.
I was surfing the Internet using google chrome while listening to musing with pandora. Suddenly there was a load non-constant booming noise from the external speakers. I tried to lower the volume using the mouse but the cursor would not move. The noise was very loud and I was afraid of damage to the speakers so I turned the volume very low on the speakers.
After a couple of minutes of trying to do something I gave up and pressed the power switch. This seemed to do nothing so I held the power button down long enough to power off. Then I restarted.
After rebooting I adjusted the speaker volume to be fairly low at the maximum setting on the computer. Perhaps if this lock-up happens again it will be less scary. I hope it doesn't happen while I am sleeping...
I am adjusting my initial score for the Mac mini:
Ubuntu Linux 10
Mac mini 7
Windows 7
Having a computer lockup so soon is unexpected. Since the Mac is all stock equipment selected by Apple, I had expected very high reliability. I figured that Mac OS X would have huge uptimes like Linux. Now I suspect that I have bought a lemon. I did buy a reconditioned computer, but I figured that Apple could isolate problems and repair a computer quite well.
First Thoughts on the Mac Mini
Size
The Mac mini is my first Mac computer. I bought it so that I could get ebe working to support assembly development on OS X. The most obvious feature of the mini is its small size. It's roughly the size of a Wii, which is like a fairly thick book.
OS X
OS X Mountain Lion was installed and I had no problems getting it set up with a seyfarth account for first use. I also rapidly stumbled (or was led) into performing an update to 10.8.1.
I got somewhat used to the dock and the system bar at the top of the screen without a lot of grief. It felt like the system was not taking much advantage of the right mouse button.
Safari and everything else seems to scroll backwards with the mouse wheel. I haven't considered if one way has some inherent virtue, but I do find it annoying when I forget and scroll the wrong way.
Monday, August 06, 2012
xterm fonts
I needed to figure out how to cope with setting the font size for xterm. Historically I have used "xterm -fn 10x20", which gives a nice font. The "-fn" option specifies a font name. Now depending on what a person has installed on their Linux system there could be a large number of fonts. Running "xlsfonts" will print a list of fonts. On my computer I noticed "terminus-32" which gave a pretty large font.
This is needed as I start letting users configure ebe. One of the configurable items will be the font for xterm which is used for terminal I/O for the program being debugged. I can't figure out a good way to settle this issue inside ebe, so I will give the user a few suggestions for fonts on my computer and suggest experimenting with the names printed by xlsfonts.
Another option is to use TrueType fonts. A useful list can be obtained using
fc-list :scalable=true:spacing=mono: family
Then you can specify a font for xterm using -fa Courier (or whatever) and specify a size using -fs 14 (or some other number). This gives more options.
This is needed as I start letting users configure ebe. One of the configurable items will be the font for xterm which is used for terminal I/O for the program being debugged. I can't figure out a good way to settle this issue inside ebe, so I will give the user a few suggestions for fonts on my computer and suggest experimenting with the names printed by xlsfonts.
Another option is to use TrueType fonts. A useful list can be obtained using
fc-list :scalable=true:spacing=mono: family
Then you can specify a font for xterm using -fa Courier (or whatever) and specify a size using -fs 14 (or some other number). This gives more options.
Sunday, August 05, 2012
Problem with after_idle
I ran into a bug with ebe recently which occurred under Debian Squeeze. When ebe was started it "flashed" the menubar preventing it from working. The same source code worked well under Ubuntu so I started looking for the problem.
I installed virtualbox on my home computer and installed Squeeze and sure enough the problem was there in the virtual Squeeze. The likely problems seemed to be python, tkinter or pmw. After some effort I managed to configure apt to allow installing packages from the testing repository. I installed newer versions of python and pmw which were pretty much the same versions as I had on Ubuntu. Still the problem persisted.
Now I knew that I was writing the line and column number of the editing cursor in the menubar in ebe, so I figured there might be some chance that I had screwed up that code. I searched and located that all over the place in ebe I used after_idle to call a function which updated the line and column information on the menubar. It looked like the problem was corralled.
I reread the documentation about the Tkinter after_idle function. It claimed that after_idle would call a function once for a call to after_idle. It seemed to me that after_idle was continuing to call my function to show the location. This could happen if the location update code called after_idle or if after_idle was broken.
It turned out that after_idle was being called as a result of using my location update code. I didn't locate a place where it could have happened and the fact that the code worked on Ubuntu and Windows makes it seem that the best bet was a problem with after_idle. I realize that problems can occasionally make little sense and certainly studying the Tkinter code was beyond the call of duty, so I decided to solve the problem without figuring out exactly why the problem ever showed up.
The solution was pretty simple. I added an additional function, show_location1, which I interposed between show_location which calls after_idle and show_location2 which actually does the location updates. I am now using after_idle to call show_location1 and show_location1 calls after to trigger a call to show_location2 after 500 msecs. The problem still exists, but updating the location twice a second doesn't interfere with the normal operation of ebe.
My expectation is that this is not a problem with my code, but I am not certain. It makes me think that perhaps I would have been better off using QT with C++ rather than python. Who knows which would cause the least trouble?
I installed virtualbox on my home computer and installed Squeeze and sure enough the problem was there in the virtual Squeeze. The likely problems seemed to be python, tkinter or pmw. After some effort I managed to configure apt to allow installing packages from the testing repository. I installed newer versions of python and pmw which were pretty much the same versions as I had on Ubuntu. Still the problem persisted.
Now I knew that I was writing the line and column number of the editing cursor in the menubar in ebe, so I figured there might be some chance that I had screwed up that code. I searched and located that all over the place in ebe I used after_idle to call a function which updated the line and column information on the menubar. It looked like the problem was corralled.
I reread the documentation about the Tkinter after_idle function. It claimed that after_idle would call a function once for a call to after_idle. It seemed to me that after_idle was continuing to call my function to show the location. This could happen if the location update code called after_idle or if after_idle was broken.
It turned out that after_idle was being called as a result of using my location update code. I didn't locate a place where it could have happened and the fact that the code worked on Ubuntu and Windows makes it seem that the best bet was a problem with after_idle. I realize that problems can occasionally make little sense and certainly studying the Tkinter code was beyond the call of duty, so I decided to solve the problem without figuring out exactly why the problem ever showed up.
The solution was pretty simple. I added an additional function, show_location1, which I interposed between show_location which calls after_idle and show_location2 which actually does the location updates. I am now using after_idle to call show_location1 and show_location1 calls after to trigger a call to show_location2 after 500 msecs. The problem still exists, but updating the location twice a second doesn't interfere with the normal operation of ebe.
My expectation is that this is not a problem with my code, but I am not certain. It makes me think that perhaps I would have been better off using QT with C++ rather than python. Who knows which would cause the least trouble?
Monday, July 16, 2012
KDE Focus Stealing Prevention
I spent a little time last night trying to devise keystrokes which I could use in ebe to switch the current window rapidly. Ebe has a total of 6 windows and finding the right one from a task bar can be a little tedious.
I first considered using the Windows key (Mod4 for Tkinter) along with a letter to switch. I am already using Windows + S to start synaptic, so that may be a problem. Then I considered briefly Alt. I am already using Alt + D to bring up the Data menu which is a slight conflict. I may eliminate the Data menu and use Alt, but for now I am using Shift+Control.
It took a little while before I learned that I needed to bind 'Shift-Control-C' instead of 'Shift-Control-c'. I don't know why you have to tell Tkinter you want a capital letter when you have already specified Shift. Perhaps I could specify 'Control-C' just as well.
These issues are fairly easy to cope with - the major problem was figuring out how to get the desired window to be on top of all the other windows. I rapidly found the "lift" function and tried console.lift() to bring the ebe console window to the front. It failed over and over. I read quite a bit before I became suspicious that my window manager, KDE, was not allowing me to make the window be the top window. That was indeed the case.
KDE uses an interesting "feature" called "focus stealing prevention". Apparently some people are annoyed by applications which suddenly jump to the top. I've used multiple window managers and I assume most of them do not have this KDE feature, but I haven't been plagued with applications popping up. (Well a long time ago I used the MacOX, before X, to implement multitasking and had to bring processes to the front to receive messages. That was a bit flashy, but off-track.)
I did discover a solution in KDE. Using the KDE main menu follow "Settings" and select "System Settings". This will bring up a settings window. Using the "Window Behavior" option on the left you get a choice for "Focus stealing prevention level". Setting this to "None" eliminates the problem.
I first considered using the Windows key (Mod4 for Tkinter) along with a letter to switch. I am already using Windows + S to start synaptic, so that may be a problem. Then I considered briefly Alt. I am already using Alt + D to bring up the Data menu which is a slight conflict. I may eliminate the Data menu and use Alt, but for now I am using Shift+Control.
It took a little while before I learned that I needed to bind 'Shift-Control-C' instead of 'Shift-Control-c'. I don't know why you have to tell Tkinter you want a capital letter when you have already specified Shift. Perhaps I could specify 'Control-C' just as well.
These issues are fairly easy to cope with - the major problem was figuring out how to get the desired window to be on top of all the other windows. I rapidly found the "lift" function and tried console.lift() to bring the ebe console window to the front. It failed over and over. I read quite a bit before I became suspicious that my window manager, KDE, was not allowing me to make the window be the top window. That was indeed the case.
KDE uses an interesting "feature" called "focus stealing prevention". Apparently some people are annoyed by applications which suddenly jump to the top. I've used multiple window managers and I assume most of them do not have this KDE feature, but I haven't been plagued with applications popping up. (Well a long time ago I used the MacOX, before X, to implement multitasking and had to bring processes to the front to receive messages. That was a bit flashy, but off-track.)
I did discover a solution in KDE. Using the KDE main menu follow "Settings" and select "System Settings". This will bring up a settings window. Using the "Window Behavior" option on the left you get a choice for "Focus stealing prevention level". Setting this to "None" eliminates the problem.
Tuesday, July 03, 2012
Kindle version done
I decided to start on the Kindle version of my assembly book today. I consulted this see what I had done before with htlatex. I converted the book using htlatex and then ran it through calibre to convert to a .mobi file. My math and table fonts were a little small and too light, so I did a google search and found where I had posted my solution to this problem from last year.
I also had a problem with images from screenshots being too blurry. Google rapidly found a solution to convert the .eps file to .png bypassing the use of the .dvi file. That issue was easily solved.
It is now done, though the width of the screen on the Kindle is a little too narrow for my wishes. Of course the Kindle will allow rotating 90 degrees, but the Nook doesn't. I will format my epub version tomorrow.
I don't pretend to know the exact reasons but I get a lot more sales from Amazon than from B&N. I think it's about 10 to 1. Does this spell DOOM for B&N? I think B&N might keep on selling if they can keep their stores on college campuses. If Amazon smells that money, then B&N might be toast.
I also had a problem with images from screenshots being too blurry. Google rapidly found a solution to convert the .eps file to .png bypassing the use of the .dvi file. That issue was easily solved.
It is now done, though the width of the screen on the Kindle is a little too narrow for my wishes. Of course the Kindle will allow rotating 90 degrees, but the Nook doesn't. I will format my epub version tomorrow.
I don't pretend to know the exact reasons but I get a lot more sales from Amazon than from B&N. I think it's about 10 to 1. Does this spell DOOM for B&N? I think B&N might keep on selling if they can keep their stores on college campuses. If Amazon smells that money, then B&N might be toast.
Tuesday, June 26, 2012
Second Edition Assembly Book Ready
I have completed my update to "Introduction to 64 Bit Intel Assembly Language Programming for Linux". It will be visible on Amazon and Barnes and Noble within a week - probably by July 4. It is available right now from Create Space at https://www.createspace.com/3917966 for the same price as the first edition: $29.95.
The second edition is 308 pages while the first edition as 253 pages. There is very little additional assembly language content, though there are some expanded discussions and a few more examples. The chapters have the same titles. The primary change is the introduction of the ebe IDE for assembly language programming.
The cover art is nearly the same. The OpenGL program producing the intertwined cycle (it is indeed 1 cycle) is more colorful, though I toned it down somewhat from my original tubular.cpp code.
I have started revising my web pages at http://www.rayseyfarth.com to include more graphics. I intend to include a fairly extensive tutorial on ebe at http://www.rayseyfarth.com/ebe. I will also have PDF slides, source code and corrections for the book available at http://www.rayseyfarth.com/asm. I have left the original assembly language web site accessible from a link near the bottom of my main web site.
A new feature I have planned for the next few months is to prepare some assembly language tutorials which will be accessible from http://www.rayseyfarth.com/asm. I plan to host these on youtube, but I haven't started yet... Real soon now...
The second edition is 308 pages while the first edition as 253 pages. There is very little additional assembly language content, though there are some expanded discussions and a few more examples. The chapters have the same titles. The primary change is the introduction of the ebe IDE for assembly language programming.
The cover art is nearly the same. The OpenGL program producing the intertwined cycle (it is indeed 1 cycle) is more colorful, though I toned it down somewhat from my original tubular.cpp code.
I have started revising my web pages at http://www.rayseyfarth.com to include more graphics. I intend to include a fairly extensive tutorial on ebe at http://www.rayseyfarth.com/ebe. I will also have PDF slides, source code and corrections for the book available at http://www.rayseyfarth.com/asm. I have left the original assembly language web site accessible from a link near the bottom of my main web site.
A new feature I have planned for the next few months is to prepare some assembly language tutorials which will be accessible from http://www.rayseyfarth.com/asm. I plan to host these on youtube, but I haven't started yet... Real soon now...
Sunday, June 24, 2012
Kompozer
I decided I needed to start working once again on my web pages. The main page for http://www.rayseyfarth.com has been too boring. It has been simple text on a light yellow background. So I did a little googling and found that people liked bluefish pretty well. So I gave it a whirl.
I rapidly got tired of viewing the html code. It's tedious thinking in terms of a markup language when what you are thinking about is conceptually simpler. I know that I have used LaTeX for my textbook, but at least it offers some interesting things like excellent equation formatting and I also have figured out how to use htlatex fairly well to produce an ebook.
So it was time to try google again. This time I tried "wysisyg html linux" and found that people recommended kompozer. So I installed kompozer and started using it.
I found that you still have html structures at work, but you can work on them while seeing the page roughly as it ultimately will look. You can also switch over to editing the html to add a few tweaks. This seems like an acceptable compromise to me.
I have the basics of a fairly nice web site started now. I have lots of color on the front page and hopefully I haven't gone too far in the other direction. I would hate to be gaudy.
I rapidly got tired of viewing the html code. It's tedious thinking in terms of a markup language when what you are thinking about is conceptually simpler. I know that I have used LaTeX for my textbook, but at least it offers some interesting things like excellent equation formatting and I also have figured out how to use htlatex fairly well to produce an ebook.
So it was time to try google again. This time I tried "wysisyg html linux" and found that people recommended kompozer. So I installed kompozer and started using it.
I found that you still have html structures at work, but you can work on them while seeing the page roughly as it ultimately will look. You can also switch over to editing the html to add a few tweaks. This seems like an acceptable compromise to me.
I have the basics of a fairly nice web site started now. I have lots of color on the front page and hopefully I haven't gone too far in the other direction. I would hate to be gaudy.
Monday, June 18, 2012
F and C Bits
Introduction
This essay started as a brief introduction to some of the weird things I have seen on assembly languages through the ages. Then the essay turned into a search for documentation of the F and C bits for the SEL computers from a long, long time ago. I needed a shell loop to fetch some files with wget and things unfolded.I found an old manual which someone kindly scanned and placed online for the SEL 32/70 CPU. I did some fairly interesting work with a "desktop" model, the 32/27. It was advertised as being in a small box (when boxes were much bigger). It had cards which I believe were 19 inches wide and slid nicely in a cabinet with the bus running vertically in the back of the cabinet.
Tuesday, June 12, 2012
No color book ;-(
I have started revising my assembly book with the primary change being the description of using ebe for code development. Ebe uses a handful of different colors, so it would be nice to print the next edition in color. The number of screen shots in the book would be perhaps 50 and each picture could be arranged to use a small amount of toner. It seemed possible that if Create Space used some sort of printer a bit like a laser printer that perhaps a color edition of my book might be moderately cheap.
I submitted a question to Create Space and the answer was 12 cents per page for the whole book if there were any color on the inside. Assuming about 300 pages this would be $36.00 just for the per-page printing cost and the original book's list price was $29.95, so the price would need to be about twice as much. This is clearly not a sensible decision. I think that a color book for the same price might increase sales, but twice as much money sounds excessive. That would be something like the typical book cost and I personally want to keep the cost down. It might be possible to sell more expensive books, but I don't want to waste people's money.
I modified the ebe program to accept a "-g" command line option to switch it into a grayscale mode which should result in higher quality images than converting color images to grayscale. Now I am back to work updating the book.
I submitted a question to Create Space and the answer was 12 cents per page for the whole book if there were any color on the inside. Assuming about 300 pages this would be $36.00 just for the per-page printing cost and the original book's list price was $29.95, so the price would need to be about twice as much. This is clearly not a sensible decision. I think that a color book for the same price might increase sales, but twice as much money sounds excessive. That would be something like the typical book cost and I personally want to keep the cost down. It might be possible to sell more expensive books, but I don't want to waste people's money.
I modified the ebe program to accept a "-g" command line option to switch it into a grayscale mode which should result in higher quality images than converting color images to grayscale. Now I am back to work updating the book.
Assembly language on the Mac
Thanks go to Daniel Bond who allowed me to test ebe on his latest Mac laptop. The Mac turns out to almost be great for running ebe.
At first the program was dying due to yasm not being in the path. After solving that minor issue it worked fairly well with C and C++. But assembly language was not quite ready for prime time.
The first issue is that the Mac standard requires prefixing global symbols with an underscore, so I had to change my test program to define _main and call _write and _exit. I have run into this pattern before and it seems to be fairly common. That was quickly solved and then it was time to move on.
I ran gcc with the -S option to dump assembly code and found that it thought that the segments might need to be named __text and __data, but that turned out to be a non-issue. After a bit of effort I returned to .text and .data and managed to get my test program to link.
I ran into an issue with the command "mov rsi, msg" where msg was a label for an array of chars to send to _write. yasm complained that it couldn't use a 32 bit constant here. I don't fully understand why this message occurred on the Mac and not on Linux. However I got past this issue and used "mov rsi, qword msg" which resulted in a program which printed "Hello World!".
Update(Nov 13, 2012) The Mac uses addresses which are too big to fit in 32 bits. The instruction set has a 32 bit address/offset field. Adding "default rel" tells the assembler to generate rip relative addresses. So the better choice would be "lea rsi, [msg]". This is a load effective address instruction. The address field will be the difference between the address of msg and register rip (after this instruction). I eventually rolled my own in ebe with respect to gdb not knowing about line numbers.
That was not too difficult to cope with, but I ran into a problem for which I did see a solution. I did not find a debugging format choice for yasm on the Mac. Without debugging information I could build a program and execute it with no feedback. This is not acceptable. I poked around with nasm for a few minutes and it appears that nasm is 32 bit only. Both the lack of a debug format and lack of 64 bit nasm seem to be problems which should have a solution.
I am on a fairly tight schedule to try to get a new edition of my assembly book done early in July. I decided that I should not spend further time right now trying to get ebe functional with assembly language on the Mac. I would like to explore it further later.
At first the program was dying due to yasm not being in the path. After solving that minor issue it worked fairly well with C and C++. But assembly language was not quite ready for prime time.
The first issue is that the Mac standard requires prefixing global symbols with an underscore, so I had to change my test program to define _main and call _write and _exit. I have run into this pattern before and it seems to be fairly common. That was quickly solved and then it was time to move on.
I ran gcc with the -S option to dump assembly code and found that it thought that the segments might need to be named __text and __data, but that turned out to be a non-issue. After a bit of effort I returned to .text and .data and managed to get my test program to link.
I ran into an issue with the command "mov rsi, msg" where msg was a label for an array of chars to send to _write. yasm complained that it couldn't use a 32 bit constant here. I don't fully understand why this message occurred on the Mac and not on Linux. However I got past this issue and used "mov rsi, qword msg" which resulted in a program which printed "Hello World!".
Update(Nov 13, 2012) The Mac uses addresses which are too big to fit in 32 bits. The instruction set has a 32 bit address/offset field. Adding "default rel" tells the assembler to generate rip relative addresses. So the better choice would be "lea rsi, [msg]". This is a load effective address instruction. The address field will be the difference between the address of msg and register rip (after this instruction). I eventually rolled my own in ebe with respect to gdb not knowing about line numbers.
That was not too difficult to cope with, but I ran into a problem for which I did see a solution. I did not find a debugging format choice for yasm on the Mac. Without debugging information I could build a program and execute it with no feedback. This is not acceptable. I poked around with nasm for a few minutes and it appears that nasm is 32 bit only. Both the lack of a debug format and lack of 64 bit nasm seem to be problems which should have a solution.
I am on a fairly tight schedule to try to get a new edition of my assembly book done early in July. I decided that I should not spend further time right now trying to get ebe functional with assembly language on the Mac. I would like to explore it further later.
Friday, June 08, 2012
Updating the Assembly Book
I've been updating my assembly textbook. The biggest change is clearly the introduction of the ebe development environment. It's a fairly crude IDE designed primarily for assembly. It's either part of my effort to make learning assembly language easier or a fairly crude attempt to sell more books. My opinion is that is clearly a bit of both.
I got pretty tired of trying to use gdb in class when I taught assembly language. I felt that debugging was critical for assembly language and gdb was too much trouble. I tried to make some changes to a handful of IDEs to support assembly language better and I did make some improvements, but it was still a bit of an unnatural mess to use.
Ebe is a godsend to assembly language. It makes it much easier to use a debugger and I hope that translates into easier for people to learn to like assembly language. It's the great grand-daddy language of them all and forms the cornerstone of rational debugging.
The problem is that I could include an enormous number of pictures captured from ebe in the book. This would drive up the cost of the printed book. On the other hand it makes the book more valuable and will increase sales - up to some point. So there is a maximization problem. I don't know the relationship of sales to number of pictures, so I can only guess.
The images would look better in color, but the book would lose me money at the current price. There should be a charge difference based on the amount of color toner used, but the charge ignores the actual costs. I diagram with red and blue lines in 500 pages would incur the same charge as full color photographs on each page. That's crazy. Maybe Create Space can cope with a wee bit of negotiation. I doubt that having 50-100 half page or less diagrams with 5-10% filled dots would have much serious effect on printing cost. It certainly wouldn't make much difference with a color laser printer and surely that is cheap enough. Probably book format pages cost under $0.002 per page. That's 2 tenths of a cent per page or 1 dollar for a 500 page book. It really should be possible for Create Space to allow color textbooks to be printed on an actual cost (plus profit) basis. This would increase their sales!
I got pretty tired of trying to use gdb in class when I taught assembly language. I felt that debugging was critical for assembly language and gdb was too much trouble. I tried to make some changes to a handful of IDEs to support assembly language better and I did make some improvements, but it was still a bit of an unnatural mess to use.
Ebe is a godsend to assembly language. It makes it much easier to use a debugger and I hope that translates into easier for people to learn to like assembly language. It's the great grand-daddy language of them all and forms the cornerstone of rational debugging.
The problem is that I could include an enormous number of pictures captured from ebe in the book. This would drive up the cost of the printed book. On the other hand it makes the book more valuable and will increase sales - up to some point. So there is a maximization problem. I don't know the relationship of sales to number of pictures, so I can only guess.
The images would look better in color, but the book would lose me money at the current price. There should be a charge difference based on the amount of color toner used, but the charge ignores the actual costs. I diagram with red and blue lines in 500 pages would incur the same charge as full color photographs on each page. That's crazy. Maybe Create Space can cope with a wee bit of negotiation. I doubt that having 50-100 half page or less diagrams with 5-10% filled dots would have much serious effect on printing cost. It certainly wouldn't make much difference with a color laser printer and surely that is cheap enough. Probably book format pages cost under $0.002 per page. That's 2 tenths of a cent per page or 1 dollar for a 500 page book. It really should be possible for Create Space to allow color textbooks to be printed on an actual cost (plus profit) basis. This would increase their sales!
Saturday, May 05, 2012
Retirement
My time at Southern Miss is winding down after 22.5 years. Adding that time to some previous service to the state as a junior high teacher I will have enough time (with unused sick/personal leave) to retire at the end of this Spring semester (2012). It's a rather odd feeling.
I have worked at a handful of jobs over the years: grocery store worker, factory worker (one summer), garbage collector (very limited time), farm laborer (too hard), construction worker (barely), service station worker (fired for being too slow washing cars!), motel clerk (they actually have to be awake at night), high school math teacher (1 summer), junior high math teacher (1.25 years), graduate student, scientific programmer at NASA, partner in Delta Data Systems, Lockheed employee, graduate student, consultant, government expert, and finally college professor. As you might guess it seems like a long time for me to stick with 1 job for 22.5 years. I have done so and have taken the typical abuse with a typical amount of complaints. In addition I have enjoyed the job better than most. There is substantial freedom as a professor, though the current political climate in America is anti-intellectual and professors are considered lazy bums by many folks. I hope that my effort to train others has resulted in benefit to my many students. If so then I have earned my pay.
I am wondering what to do with the rest of my life. Hopefully I won't have to face poverty in retirement, though sometimes this world can be a cruel place. Assuming that we can live off my retirement income, I will try to be creative and keep myself busy with a variety of different projects. I have noticed over the past few years that my energy level seems a little lower than when I was young, so I don't want to spend the best hours of each day toiling at a job. I think I am good for perhaps 4-6 good hours a day now and jobs demand 8+. Many programming jobs requite excessive hours. Of particular note is the cruelly long hours demanded in the game programming industry. It would be fun to create great games, but not 80 hours a week. At my age (currently 59) I wouldn't last long in such a job. I can't predict whether they would fire me before I would tell them to take their job and shove it.
I need to start spending more of my time exercising. I probably need to try for some form of daily exercise. I have a hard time forming exercise habits and need to work on variety. Here's my list: dancing, zumba, walking, cycling, weight training, swimming, gardening and woodworking. The walking and woodworking aren't great aerobic exercises, but walking has been my most successful form of exercise. I have walked to/from my office at Southern perhaps 3-4 times a week for over 22 years. The rest of that list is more theoretical.
Will I get bored and wish I still had my job? I hope not. Will I get bored and take another job? That seems more likely, but I really don't want to promise to work 40 hours a week again. Will I need money? Need is relative and I have lots of needy relatives (just a pun). Seriously, need is relative. I hope I don't decide that I need money.
If I get bored perhaps I will take up a new hobby. I think I would have some fun with electronics. I'll be considering that this summer. I still think this old dog can learn some new tricks.
I have worked at a handful of jobs over the years: grocery store worker, factory worker (one summer), garbage collector (very limited time), farm laborer (too hard), construction worker (barely), service station worker (fired for being too slow washing cars!), motel clerk (they actually have to be awake at night), high school math teacher (1 summer), junior high math teacher (1.25 years), graduate student, scientific programmer at NASA, partner in Delta Data Systems, Lockheed employee, graduate student, consultant, government expert, and finally college professor. As you might guess it seems like a long time for me to stick with 1 job for 22.5 years. I have done so and have taken the typical abuse with a typical amount of complaints. In addition I have enjoyed the job better than most. There is substantial freedom as a professor, though the current political climate in America is anti-intellectual and professors are considered lazy bums by many folks. I hope that my effort to train others has resulted in benefit to my many students. If so then I have earned my pay.
I am wondering what to do with the rest of my life. Hopefully I won't have to face poverty in retirement, though sometimes this world can be a cruel place. Assuming that we can live off my retirement income, I will try to be creative and keep myself busy with a variety of different projects. I have noticed over the past few years that my energy level seems a little lower than when I was young, so I don't want to spend the best hours of each day toiling at a job. I think I am good for perhaps 4-6 good hours a day now and jobs demand 8+. Many programming jobs requite excessive hours. Of particular note is the cruelly long hours demanded in the game programming industry. It would be fun to create great games, but not 80 hours a week. At my age (currently 59) I wouldn't last long in such a job. I can't predict whether they would fire me before I would tell them to take their job and shove it.
I need to start spending more of my time exercising. I probably need to try for some form of daily exercise. I have a hard time forming exercise habits and need to work on variety. Here's my list: dancing, zumba, walking, cycling, weight training, swimming, gardening and woodworking. The walking and woodworking aren't great aerobic exercises, but walking has been my most successful form of exercise. I have walked to/from my office at Southern perhaps 3-4 times a week for over 22 years. The rest of that list is more theoretical.
Will I get bored and wish I still had my job? I hope not. Will I get bored and take another job? That seems more likely, but I really don't want to promise to work 40 hours a week again. Will I need money? Need is relative and I have lots of needy relatives (just a pun). Seriously, need is relative. I hope I don't decide that I need money.
If I get bored perhaps I will take up a new hobby. I think I would have some fun with electronics. I'll be considering that this summer. I still think this old dog can learn some new tricks.
Friday, April 20, 2012
BP Blowout in the Caspian Sea
Now the news is coming out that BP covered up an oil spill in the Caspian Sea in 2008. Guess what! The cause was probably the same cause as the Gulf spill in 2010. Had this problem been reported as it should have, then 11 oil rig workers might still be alive and the damage to the environment might have been avoided.
Is it time for BP to be responsible for its actions? Will the US charge anyone with a crime for covering up the 2008 blowout? I have no faith that our government will do anything about it.
Is it time for BP to be responsible for its actions? Will the US charge anyone with a crime for covering up the 2008 blowout? I have no faith that our government will do anything about it.
Thursday, April 12, 2012
Coping with Global Warming
I watched a video on Thorium Molten Salt reactors today and it seemed to me that this is part of the solution to our energy problem and to global warming. I have thought about terraforming the world's deserts and my first thought was to desalinate seawater to water the Sahara. I originally thought that solar power might be the best way to desalinate the water for the Sahara, but now I think thorium is the proper solution.
Thorium reactors are safer and thorium is plentiful, so we have a cheap energy source which will not produce greenhouse gases. Contrasted to conventional nuclear power plants, thorium leaves a solvable waste problem.
So we can build reactors on the African coast and produce clean water for agriculture which can be pumped to the Sahara. Over time the Sahara can be converted into a rich region with agriculture, forests and human habitation. With enough of the Sahara terraformed there will be additional water vapor entering the atmosphere and there will be increased rainfall which will amplify the effect and spread the good fortune.
As the Sahara is converted it seems to me that this increased biomass will help to fight the warming effects of the greenhouse gases. Ultimately we can change the destiny of earth from ecological disaster from global warming into abundance.
Will we conquer our ecological problems or continue to keep our heads stuck in the sand?
Thorium reactors are safer and thorium is plentiful, so we have a cheap energy source which will not produce greenhouse gases. Contrasted to conventional nuclear power plants, thorium leaves a solvable waste problem.
So we can build reactors on the African coast and produce clean water for agriculture which can be pumped to the Sahara. Over time the Sahara can be converted into a rich region with agriculture, forests and human habitation. With enough of the Sahara terraformed there will be additional water vapor entering the atmosphere and there will be increased rainfall which will amplify the effect and spread the good fortune.
As the Sahara is converted it seems to me that this increased biomass will help to fight the warming effects of the greenhouse gases. Ultimately we can change the destiny of earth from ecological disaster from global warming into abundance.
Will we conquer our ecological problems or continue to keep our heads stuck in the sand?
Friday, April 06, 2012
Heaven or Hell - Paradise or Oblivion
I want to recommend that you view the on-line film "Paradise or Oblivion". This video is produced by The Venus Project. The previous links are to the Venus Project main site which embeds the video.
The Venus Project is the brainchild of Jacques Fresco, who is a self-educated designer of a new world. Jacques was born in 1916 and observed the terrible conditions of the Great Depression and was sensible enough to recognize that this tremendous problem was not a result of a natural calamity, but rather the result of a failed economic system. We in the US still have essentially the same economic system and, from time to time, we experience recessions or depressions as a result.
It has been one of my recent thoughts that humankind is on the threshold of a dream. Our advanced technology has been decreasing the real need for people to work. Without going into too many details, we now produce our food by the work of about 1% of the population. Except for distribution systems and the need for money to buy the food, 99% of us could have free food.
Most of our products are being increasingly produced by automation. My prediction is that we could reach a point where practically all our manual labor needs could be served by machines. I view this as humans reaching a point where we could choose to have Heaven on Earth - or we could have Hell on Earth. The title of the Venus Project video is "Paradise or Oblivion" which is a paraphrasing of Heaven or Hell and the concept is the same as my own ideas. Jacques has spent about 75 years pursuing this topic, while I have spent only a few hours. I am convinced that a huge change for the better is possible and the "Paradise or Oblivion" video explains it better and in more detail than I can.
The major concept of the video is to establish a "Resource Based Economy", which means no money. Everything is freely available to everyone. I don't yet see how to make the transition, but the idea has great merit.
Let's consider the automation of the food system. We currently are pretty efficient at food production. There is unfortunately a lot of wasted effort involved in the distribution system. Consider having an automated grocery "store" where you can select what you want and take it home without having people scanning prices and collecting money. This would also be true for all other "stores". You could go to a fast food store and have a machine make you a hamburger and fries for free. This would surely reduce the need for human labor.
The ultimate end of this process of automation is the elimination of the need for humans to work at tedious jobs. It isn't clear that we can eliminate all human labor in the near future, but I think that this is basically possible using robotics.
Let's assume that we achieve tremendous advances in automation and only 10% of the human population is required to work. Probably before then we would have reached a decision point: "Do we choose Heaven or Hell?" If we continue with a capitalist economy will we have 90% unemployment? I believe that the only rational decisions would be to reduce the work week or transform into a resource based economy. Doing so could produce Heaven or Paradise. Doing otherwise will result in more and deeper depressions accompanied by social upheaval, crime, violence and war.
A critical part of planning the future of life on earth is the recognition that humans must design the environment to allow sustainable habitation. We must live in harmony with nature. We must end pollution. We must restrict human population.
The future of Earth demands that human society evolve into a kinder, gentler, more cooperative society. We must learn to cooperate with people of all nations and the prosperity made possible by human ingenuity must be available to all.
The Venus Project is the brainchild of Jacques Fresco, who is a self-educated designer of a new world. Jacques was born in 1916 and observed the terrible conditions of the Great Depression and was sensible enough to recognize that this tremendous problem was not a result of a natural calamity, but rather the result of a failed economic system. We in the US still have essentially the same economic system and, from time to time, we experience recessions or depressions as a result.
It has been one of my recent thoughts that humankind is on the threshold of a dream. Our advanced technology has been decreasing the real need for people to work. Without going into too many details, we now produce our food by the work of about 1% of the population. Except for distribution systems and the need for money to buy the food, 99% of us could have free food.
Most of our products are being increasingly produced by automation. My prediction is that we could reach a point where practically all our manual labor needs could be served by machines. I view this as humans reaching a point where we could choose to have Heaven on Earth - or we could have Hell on Earth. The title of the Venus Project video is "Paradise or Oblivion" which is a paraphrasing of Heaven or Hell and the concept is the same as my own ideas. Jacques has spent about 75 years pursuing this topic, while I have spent only a few hours. I am convinced that a huge change for the better is possible and the "Paradise or Oblivion" video explains it better and in more detail than I can.
The major concept of the video is to establish a "Resource Based Economy", which means no money. Everything is freely available to everyone. I don't yet see how to make the transition, but the idea has great merit.
Let's consider the automation of the food system. We currently are pretty efficient at food production. There is unfortunately a lot of wasted effort involved in the distribution system. Consider having an automated grocery "store" where you can select what you want and take it home without having people scanning prices and collecting money. This would also be true for all other "stores". You could go to a fast food store and have a machine make you a hamburger and fries for free. This would surely reduce the need for human labor.
The ultimate end of this process of automation is the elimination of the need for humans to work at tedious jobs. It isn't clear that we can eliminate all human labor in the near future, but I think that this is basically possible using robotics.
Let's assume that we achieve tremendous advances in automation and only 10% of the human population is required to work. Probably before then we would have reached a decision point: "Do we choose Heaven or Hell?" If we continue with a capitalist economy will we have 90% unemployment? I believe that the only rational decisions would be to reduce the work week or transform into a resource based economy. Doing so could produce Heaven or Paradise. Doing otherwise will result in more and deeper depressions accompanied by social upheaval, crime, violence and war.
A critical part of planning the future of life on earth is the recognition that humans must design the environment to allow sustainable habitation. We must live in harmony with nature. We must end pollution. We must restrict human population.
The future of Earth demands that human society evolve into a kinder, gentler, more cooperative society. We must learn to cooperate with people of all nations and the prosperity made possible by human ingenuity must be available to all.
Saturday, January 14, 2012
InstallJammer
I installed InstallJammer (http://www.installjammer.com/) on my Linux computer this week to develop installers for Windows versions of my ebe program. Ebe requires gcc, gdb, gfortran and python in addition to the ebe code. Many people would prefer a simpler installation process. InstallJammer does the job.
InstallJammer is a Tk/tcl script with quite a long list of options for preparing an installation file/cd. I only wanted it for Windows, but it can build installers for Linux and a variety of other operating systems.
I took me a while to guess some things which could have been easy. To their credit the IJ team has a fairly extensive user guide, but I needed to know things like using the virtual directory <%DESKTOPDIRECTORY%> is the right choice to have an icon be placed on the desktop for all users. I got tired of searching for that answer and started guessing.
Overall I am quite pleased with InstallJammer. I can cope with it pretty well now. I expect that I don't really know how to use it well. Thumbs up!
InstallJammer is a Tk/tcl script with quite a long list of options for preparing an installation file/cd. I only wanted it for Windows, but it can build installers for Linux and a variety of other operating systems.
I took me a while to guess some things which could have been easy. To their credit the IJ team has a fairly extensive user guide, but I needed to know things like using the virtual directory <%DESKTOPDIRECTORY%> is the right choice to have an icon be placed on the desktop for all users. I got tired of searching for that answer and started guessing.
Overall I am quite pleased with InstallJammer. I can cope with it pretty well now. I expect that I don't really know how to use it well. Thumbs up!
Monday, January 09, 2012
Syntax highlighting
I have used the ply.py package by David Beazley (http://www.dabeaz.com/ply/) to implement syntax highlighting in my ebe IDE. Ply.py is "lex and yacc for Python". I only needed the lex part of break out the different categories of tokens. It was fairly easy to implement highlighting code for C/C++, Fortran and Assembly. I like the appearance of the colorful assembly code. There was apparently a tab before the 56 in the code which I did not notice when I took the screenshot, but the colors are still nice.
Sunday, January 01, 2012
Stupid tk scrollbar limit (OOPS - It's my fault)
Sometimes I love to complain. I have been quite successful getting my ebe programming environment working. It does a large number of editing tricks now. I think I may have figured out most of how to use the tkinter Text widget.
Things worked great testing copy and paste until my file got over a couple of thousand lines long. The scrollbar failed to work properly.
Things worked great testing copy and paste until my file got over a couple of thousand lines long. The scrollbar failed to work properly.
Subscribe to:
Posts (Atom)