...making Linux just a little more fun!
Dear Mr.Okopnik
My name is Liang Jun-Ming,a student from Taiwan.
I'm suffering from a programming problem,I would very much appreciate receving an answer from you ! I wrote a testing program named hello.s , and a linker script named ldscript as follows:
See attached liong.hello.s.asm.txt
after " as hello.s -o hello.o" and "ld -Tldscript hello.o -o hello" I get an executable named hello.
My question is:
What does "AT(0x3000000)" mean ?
Does it mean that the loader will load this executable at "physical address " 0x3000000 ?
I know the "virtual address" of the first byte of this executable would be 0x1000, but in Linux , can we put data at any physical address as we wish ? If it does, why the program still works even if the RAM is 32M in my PC ?(0x3000000 > 32M). What tool in Linux can we have to let us "watch" the contents of memory by specifying "physical addresses"? If it doesn't, what is the function when we write "AT(xxxx)" ? Hope I can receive an answer when you are not busy. Thank you very much!
[Ben] Hi, Jun-Ming -
I'm afraid your question is somewhat misdirected: I'm not an assembly expert, under Linux or otherwise. My suggestion to you would be to start at http://linuxassembly.org and go from there - their front page reads
............... Welcome to the Linux Assembly! If you are looking for information on assembly programming under UNIX-like operating systems (Linux/BSD/ BeOS/etc), this is the right place to be. Here you can find various resources, ranging from tutorials and documentation, to actual programs written in assembly language. As time passes, we will try to provide as much information on the subject as possible, so stay tuned. ............... |
That seems like the right place for your query.
[Jimmy O'Regan] The AT() keyword is for things like ROMs. I recommend you read the GNU Linker manual:
http://www.gnu.org/software/binutils/manual/ld-2.9.1/html_chapter/ld_3.html#SEC21
Dear Answer Gang:
According to the GNU linker ld manual:
the AT() keywod specifies the load address of a section, and it says "this feature is designed to make it easy to build a ROM image..."
Query,
( forgive me for a Chinese student's poor English !)
[Jimmy] The AT() keyword can be used for ROMs - if you want to write a replacement BIOS (such as Linux BIOS: http://www.linuxbios.org), you will have to do use the AT() keyword; or if you are creating a ROM images for later use in an emulator, or to write to a physical ROM.
You can also use the AT() keyword for boot loaders/kernels, which need to be at a specific location in RAM to be executed; and in a normal program. If the program has a specified load address, and is loaded on an MMU-less system, or in an OS which doesn't use the MMU, then you get access to that specific area of memory, but in an OS (such as Linux) which makes use of the MMU, the address is transparently remapped to an address within the space allocated to your program by the kernel.
Jimmy also asked a friend... -- Heather
[Jimmy] Sorry about the format this takes; I asked a friend from college if he could answer the linker script question, the answer is in the attached IRC log. There's a lot of overview in there which I thought was interesting. Philip's credentials are that he wrote an operating system for his degree thesis, based on KeyOS (http://keyos.sourceforge.net), to which he contributed code under a pseudonym (the college made some claims about copyright...).
Logged from the UnderNet IRC on Jun 20.
-- Heather
...............
............... |
Hello
I had used the following script for launching Firefox (earlier named firebird) (See my article Mozilla Firebird - A review (http://linuxgazette.net/issue97/shekhar.html) to see how you can use this).
#!/bin/sh /usr/lib/mozilla-firebird/MozillaFirebird -remote "openURL('$@', new-tab)" || exec /usr/lib/mozilla-firebird/MozillaFirebird "$@";
However, with the 0.9 release (the latest one, which is even more slick and fast), this stopped working. Instead of launching the new tab, the Profile Manager UI pops up. This was reported as bug http://bugzilla.mozilla.org/show_bug.cgi?id=246168 in the Mozilla Bugzilla.
The reason for this is the change in the format of calling the remote command. The new way of doing this is:
firefox -a firefox -remote openURL(<url>,new-tab)
Note that there should be no space between the the comma and the command after the url (new-tab in this case, you can also use new-window to start a new window) or you get a "Error: Failed to send command: 509 internal error".
So the script to launch firefox becomes
#!/bin/sh /usr/lib/firefox/firefox -a firefox -remote "openURL("$@",new-tab)" || exec /usr/lib/firefox/firefox "$@";
[Ben] I just had the same problem with the new Mozilla upgrade; the trouble is in the brain-dead URL parser at the end of the wrapper script. Although I fixed it, it very quickly became useless: I downloaded Mozilla 1.7 from http://mozilla.org, and its wrapper script works fine.
Oh, and since you brought this issue up: just yesterday, I was reading about Mozilla's "remote" methods in order to fix the above problem - and still forgot, completely, that there's a "native" way to test if Mozilla is running or not.
Wonder if I can trade this brain in for a newer model?
mozilla -remote "ping()" 2>/dev/null && mozilla -remote "openurl($1,new-window)" || mozilla $1
This one courtesy of LWN. You want to build a package from the latest source, but have it managed by your favourite package manager. Checkinstall claims to automate the process for Debian (presumably any system using dpkg?), Slackware and RPM based systems. I gotta have it
Publication by LWN is hereby permitted
[Thomas] I have used both, and my personal preference would be the use of stow over checkinstall.
Typing stow as a keyword into the search box at freshmeat.net also reveals some interesting competitors, and a front end for stow.
Also, Allan Peda had an article on this topic in Issue 75, Simple Package Management With Stow -- Heather
One for Ben: a periodic table of Perl 6's operators.
http://www.ozonehouse.com/mark/blog/code/PeriodicTable.html
[Ben] "Today, we're going to learn about one of the varieties of serious mental disturbance. Here, for example, is a distinctly pathological case..."
It's got some amount of cuteness to it, but I think you'd have to be a bit obsessed to actually do the thing up. Reminds me of an excellent model of the Titanic, about 8' long IIRC, built out of matchsticks - all the way down to the deck chairs and the oars in the lifeboats - that I saw at an exhibition of artworks done by mental patients. Much of the work was incredible, brilliant, and unrepeatable in many cases - and the stories (such as that of a woman who made these shockingly beautiful patterns from threads she'd pluck out of rags... and almost all of whose work had been thrown away because it was just "trash" made by "crazy Nancy") would break your heart.
Hi Guys
Here's another contribution. Hopefully, you can publish it as a 'two cent tip'
As part of a PHP web app I'm playing with, I needed to authenticate the web client user with a remote system. Unfortunately, this system is a mainframe and setting up a web-enabled authentication product on it is somewhat timeconsuming and requires a lot of administrivia. I wanted to avoid all that, so I had to come up with another way to authenticate web users remotely.
The one TCP/IP networked app our mainframe has available is FTP. Now, the FTP protocol implements security processes with the 'USER' and 'PASS'word commands, and our host security people have ensured that the host FTP server requires these two functions. In our case, the 'USER' and 'PASS' functions on the server interface with the ACF2 security system to validate that the given userid and password combination are correct, and will not let an FTP connection in if they aren't.
I use this little tidbit of information to let me authenticate web users of my Linux box by forcing their web browsers to pop up the Authentication panel, and sending their entered userid and password information to the host in an FTP 'USER' and 'PASS'word command sequence. If the host's FTP rejects the sequence, then the user isn't authorized, but if the host's FTP accepts the sequence, then the user is valid to the host. In either case, I don't actually transfer files over the FTP link; I simply close it unused. I only need it for the authentication.
Neat or what?
Here's an example PHP script that demonstrates the process. It needs an ftp server in order to work, and is (for demonstration purposes) set up to talk to the ftp server at localhost...
<?php /* ** LoginPrompt() sends headers and html with the intent of ** inducing the web-browser to display it's built-in userid/password ** prompt. ** It sends a WWW-Authenticate header to give the authentication specs, ** a HTTP 401 on the current page requested by the browser, and ** a dummy HTML page to be displayed if the user cancels the ** login prompt ** It then exits, causing php to terminate the current transaction ** without further output */ function LoginPrompt($URL) { /* force the login popup to show up */ Header("WWW-Authenticate: Basic realm=\"System Login\""); Header("HTTP/1.0 401 Unauthorized"); /* if the user hits Cancel, send him to a place he cant hurt us from */ echo "<meta HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=$URL\">"; exit; } $userid = $_SERVER['PHP_AUTH_USER']; $passwd = $_SERVER['PHP_AUTH_PW']; $validuser = "no"; if ($userid && $passwd) { /* connect to FTP server, see if it accepts the given userid & password */ $conn = ftp_connect("localhost") or die("Cant connect"); if (@ftp_login($conn,$userid,$passwd)) $validuser = "yes"; ftp_close($conn); if ($validuser == "no") /* bad user - try the login again */ LoginPrompt("http://www.php.net/manual/en/features.http-auth.php"); } else /* first time into this page - force the 1st login prompt */ LoginPrompt("http://www.php.net/manual/en/features.http-auth.php"); phpinfo(); ?>
This is in reply to:
http://linuxgazette.net/103/lg_tips.html#tips.4 -- Thomas Adam
Regarding Xserver spits multiple windows to foreign Xclient:
I have no knowledge of Exceed. I use cygwin to connect to unix/linux boxes.
You have to configure/install cygwin with X (and ssh, if you're going to use
that, and why not?). Crucial step is to start an xwdm (blackbox I think,
whatever is available on Cygwin) first, and start linux x-apps from inside the
xwdm (start with an xterm!). The full screen x-windows display manager is
actually running locally, while the windowed apps are in the dm.
Chris C
Ambassador of Pain - quite entertaining for 64 lines of code. (That's in C, mind you; if it was Perl, I'd be expecting Quake3, including the PAK file.
A while back, Groklaw mentioned that they wanted to have a Linux usability test, and technical documentation written for new users. They've started a wiki (based on the Wikipedia software) to do this:
http://www.grokdoc.net/index.php/Main_Page