avr-ar question

Go To Last Post
31 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Would anyone happen to know the structure of the data returned when doing a avr-ar -tv xxxx.a ??

This is an example of data returned.

rw-rw-rw- 0/0 43786 Jan 07 23:37 2010 regex.o

rw-rw-rw- 0/0 is what I having trouble with.
          |---| ???
|---------| Permissions but for what??

Any help appreciated.[/code]

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mike32217 wrote:
Would anyone happen to know the structure of the data returned when doing a avr-ar -tv xxxx.a ??

File permissions for Unix. The first three characters are the user (aka owner) permissions, the second three the group permissions, the last three the rest-of-the-world permissions.

The two numbers represent the user ID and group ID of the file. Every file in Unix is owned by one user and also owned by a group. Internally users and groups are identified by numbers. The numbers are associated with names (e.g. via the information in /etc/passwd and /etc/group and on larger installations via systems like NIS).

ar is the traditional Unix archiver. For one reason or another it really never caught on as a general archiver on Unix, but became the tool for making library files. .a files are just a bundle of .o files. In the old days one also needed ranlib to properly index and sort the contents of a .a file, so the linker could find the symbols in the .o files in the .a in the right order. That made a generic .a into something the linker could use. This sorting and indexing was not considered the job of ar, because ar was just intended as archiving tool. These days ar does the ranlib job on its own, and using ranlib went the way of the Dodo.

The general Unix archiver is tar, aka tape archiver. Only that people rarely read/write tapes with it these days, and one anyhow needs mt (magnetic tape control) to handle tapes on Unix.

Stealing Proteus doesn't make you an engineer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ArnoldB, that was a very full reply.
But you forgot to mention changing ownership (chown), group (chgrp) and setting the permissions yourself (chmod) ;)

--greg
Still learning, don't shout at me, educate me.
Starting the fire is easy; the hardest part is learning how to keep the flame!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ArnoldDB thanks you for your definitive answer. I was thinking of making a windows GUI to handle the librarian duties so these two fields don't seem to be an issue in this case.

Thanks,

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You probably know his already but the ar manual is here:

http://sourceware.org/binutils/d...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson

Quote:

You probably know his already but the ar manual is here:

I googled last night for a couple of hours and ran across a lot of good literature but none explained these fields. I guess because my focus was on windows and not linux. :)

As a side note do you think that a GUI would be beneficial?
I'm not a command line person...we're not in DOS anymoe toto.

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I'm not a command line person...we're not in DOS anymoe toto.
You can achieve a great deal more with the command line than you ever will with a simpleton gui. :)
BTW: REAL programmers still use 'vi' :)

--greg
Still learning, don't shout at me, educate me.
Starting the fire is easy; the hardest part is learning how to keep the flame!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

gregsmithcts,

You must be a non-windows person. Nothing wrong with command line but as I'm getting older it's harder to remember all the options and a heck of a lot easier to drag and drop!

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah, sorry, Unix and Mac! Windoze is purely for work :(

And call me Greg... the cts is just a unique handle :)

--greg
Still learning, don't shout at me, educate me.
Starting the fire is easy; the hardest part is learning how to keep the flame!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok Greg, I'm still a newbie so don't know everyone yet.

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

You must be a non-windows person. Nothing wrong with command line but as I'm getting older it's harder to remember all the options and a heck of a lot easier to drag and drop!
I am predominantly a "Windows Person" yet I still do most things at a Command Prompt. There are options in xcopy that I wouldn't have a clue how you could do with "explorer".

BTW I don't see the point in a GUI for avr-ar as it's possibly one of the least used tools in the entire avr-gcc toolchain. No one seems to use .a for AVRs because to support all the models it would need bloaty run-time checks to determine the device type and hence the SFR register set. Most "libraries" are #if configurable sets of source that you actually build along with your project. Given the speed of modern PCs and the fact that the maximum binary you could ever create is 256K there's not much penalty in doing this at compile time rather than link time.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson,

Thanks that answers my question, I hadn't thought about all the ramifications.

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

You must be a non-windows person. Nothing wrong with command line but as I'm getting older it's harder to remember all the options and a heck of a lot easier to drag and drop!

I'm 50+. I find great joy in the options to command line utilities are constant over time, while the way to do things in Windoze Explorer changes every time anyone at MS farts.

E.g.

> dir /s /b 

rules! Simpe. To the point. And if your memory fails you then just

> help dir

or

> dir /?

P.S. and OT: I guess a massive outbreak of flatulence has occurred at MS. I have, for the last two months, been struggling with the (not so new, but for me) Office2008 where 15 years of office knowledge was thrown down the drain in an instance. DS.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I struggle with M$ stuff every day but Windoze is the way the prevailing wind blows so there go I.

My biggest problem is they don't seem to care about fixing problems just moving on to the next big WizBang.

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Windoze is the way the prevailing wind blows

My point was that for some things, this need not necessarily be true. E.g. the DIR command has been very stable for something like 25 years. Same for e.g. COPY.

Really, the most efficient seems to be using each environment when it fits the best. As for switching between them, here are some favourite manouvres:

- Whenever at a command prompt in a certain directory ("folder", if that suits you better) and you want to switch to a Windows Explorer, simply issue this command:

start .

- For going the other way, locate the Windows "powertoy" "Command Prompt Here" and install it. In the System menu if Windows Explorer you can now start a command prompt in the folder that is selected in Explorer.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One of the joys of having WinAVR installed is that it even brings Win32 built copies of many of the popular Linux commands with it. I love the fact that you have grep, find, b(un)zip2, cp, diff, du, g(un)zip, ls, md5sum, rm, rmdir, sed, sh, sort, tail, tar, touch, wc, wget and these are just some of the highlights among:

 Directory of C:\WinAVR-20100110\utils\bin

[.]                [..]               ansi2knr.exe       basename.exe
bc.exe             bison.exe          bison.hairy        bison.simple
bunzip2.exe        bzcat.exe          bzip2.exe          cat.exe
chgrp.exe          chmod.exe          chown.exe          cksum.exe
cmp.exe            comm.exe           compress.exe       cp.exe
csplit.exe         cut.exe            date.exe           dc.exe
dd-old.exe         dd.exe             df.exe             diff.exe
diff3.exe          dircolors.exe      dirname.exe        du.exe
echo.exe           egrep.exe          env.exe            expand.exe
expr.exe           factor.exe         false.exe          fgrep.exe
find.exe           flex.exe           flex.lib           fmt.exe
fold.exe           fromdos.exe        fsplit.exe         gawk.exe
gclip.exe          gplay.exe          grep.exe           gsar.exe
gunzip.exe         gzip.exe           head.exe           id.exe
indent.exe         info.exe           infokey.exe        install-info.exe
install.exe        join.exe           jwhois.exe         less.exe
ln.exe             logname.exe        ls.exe             m4.exe
make.exe           make.exe.old       makeinfo.exe       makemsg.exe
man.exe            md5sum.exe         mkdir.exe          mkfifo.exe
mknod.exe          mount.exe          msys-1.0.dll       msys-1.0.dll.old
mv.exe             mvdir.exe          nl.exe             od.exe
paste.exe          patch.exe          pathchk.exe        pclip.exe
pr.exe             printenv.exe       printf.exe         ps.exe
pwd.exe            rm.exe             rman.exe           rmdir.exe
sdiff.exe          sed.exe            seq.exe            sh.exe
shar.exe           sleep.exe          sort.exe           split.exe
stego.exe          su.exe             sum.exe            sync.exe
tac.exe            tail.exe           tar.exe            tee.exe
test.exe           texindex.exe       todos.exe          touch.exe
tr.exe             true.exe           type.exe           uname.exe
unexpand.exe       uniq.exe           unshar.exe         uudecode.exe
uuencode.exe       wc.exe             wget.exe           wget.hlp
which.exe          whoami.exe         xargs.exe          yes.exe
zcat.exe
===============================================================================

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I love the fact that you have grep [...]

The sad part is that it's functionality for recursive searching is broken in Windoze. Apart from that, grep must be one of the finest little programs ever written.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Sun. Mar 6, 2011 - 06:20 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson,

Very cool thanks for the powertoys tool tips...they are included in Windows 7 and never new it, just have to find out how to use it. (Not showing up in right click context menu but I think it's supposed to?)

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

just have to find out how to use it

Navigate to any folder. Now right-click on the icon at the far left of the title bar of the Explorer. (Going on memory, the computer I'm using right now does not have Powertoys installed.)

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh man that is so cool I've been doing it the long way for so long...you are the man.
Only thing is I'm using Windows 7 64-bit and the trick is you have to Navigate to the folder then hold the Shift then right click.

Thanks a bunch command prompt guy. :)

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Thanks a bunch command prompt guy.

Is it a bird? Is it a plane?
No! It's the Command Prompt Guy!!
:D

Don't feel too bad that you didn't know. Those two tricks are, for some obscure reason, a well kept secret between a few people. About 75% of the persons I show those tricks to react the same way as you do.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

For going the other way, locate the Windows "powertoy" "Command Prompt Here" and install it. In the System menu if Windows Explorer you can now start a command prompt in the folder that is selected in Explorer.

A bit too GUI for me. If I want to get from one place to another in a command prompt I use CD. Spot the luddite!

I do use the [Tab] key a lot (hangover from using bash) to do file and pathname completion so to CD to the AVR Studio help files directory I'd actually type:

CD \Pro[Tab]\At[Tab]\AV[Tab]\He[Tab]

which arrives at:

C:\Program Files\Atmel\AVR Tools\Help>

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
CD to the AVR Studio help files directory I'd actually type:

Create an environment variable called THEDIRECTORYIWOULDLIKETOCDTOWHENIWANTASHORTCUT... or maybe not :) That contains the path to THE... (you get the gist).
Then simply cd $t
Now, I do this ALL the time with *ix systems (at work and home) but never do with M$. In fact, my .bashrc / .profile / .cshrc (whatever the platform) contains at least 50 lines of alias and command shortcut's that I've used for 30+ years (so I know them off by heart).

It aught to work with M$ :)

--greg
Still learning, don't shout at me, educate me.
Starting the fire is easy; the hardest part is learning how to keep the flame!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

If I want to get from one place to another in a command prompt I use CD.

That's not the point. The point is: If you're doing some work where Windoze Exploder actually fits your MO better, and then need to do some command prompt work better, Powertoys offer a neat way to get there quickly.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Over the years I learned just enough Unix to get me by. I just prefer working with a GUI as opposed to command line.
Don't get me wrong I started on an Apple II/e under ProDOS years ago writing assembler code so I've been around the block. :)

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I can rig up a special-purpose code generator / application-specific language in 15 minutes in Unix. That's faster than it takes a GUI jockey to find the start button for a useless "Wizard" doing nothing what really needed to be done.

Stealing Proteus doesn't make you an engineer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
I am predominantly a "Windows Person"

@Cliff .. You mean ms-dos 2.11 person :wink:

The options was less at that time 8)

YIIKES command.com not found

I do recall too.

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ArnoldB wrote:
I can rig up a special-purpose code generator / application-specific language in 15 minutes in Unix. That's faster than it takes a GUI jockey to find the start button for a useless "Wizard" doing nothing what really needed to be done.

I'm not disputing the merits of Unix or using the command line as opposed to GUI, I just personally prefer GUI.
I may not be as fast to get an app coded in Visual Studio but I've whipped up some small apps in pretty good time.

B.T.W. I don't need no stinking wizard. :)
We have no badges. In fact, we don't need badges. I don't have to show you any stinking badges

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Real Programmers just need a line editor and a fortran compiler. (I thought this famous rant was Right On when I first saw it about 30 years ago on a bulletin board echo of a usenet feed of comp.arch or something like that)

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I first saw it about 30 years ago
Heh... busted!

--greg
Still learning, don't shout at me, educate me.
Starting the fire is easy; the hardest part is learning how to keep the flame!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bobgardner wrote:
Real Programmers just need a line editor and a fortran compiler. (I thought this famous rant was Right On when I first saw it about 30 years ago on a bulletin board echo of a usenet feed of comp.arch or something like that)

HaHa yeah that was a good one. Hey wait a minute I guess I'm dating myself too! (Well not actually dating...ah you know what I mean) :)

Happy Trails,

Mike

JaxCoder.com