RE: [SLUG] Portfw: iptables or tcp proxies
> TCP layer proxies are also able to insulate your network from > "broken TCP packets". The problem is that unless you run a > well-written TCP proxy, you then open up your firewall to attack. > > If you're just using this to forward to SSH, then I'd be > using packet-forwarding. If it's web, I'd probably run Squid > or similar in front of your web-server. But straight "TCP > proxies" don't offer that many benefits on their own unless > you have very specialised needs (assuming you keep your > kernels patched on the machines in your network). Thanks. We use simpleproxy (http://sourceforge.net/projects/simpleproxy/) mainly to forward Citrix connections to multiple internal Windows 2003 servers and one firewall to an Exchange server. Incoming traffic can be high at times so speed and stability is important. I also think the likelihood of simpleproxy failing is higher than using iptables (?). Carlo -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
[SLUG] Mail madness
Hi, For some reason uni has stopped pop and imap access to the groupwise mail system. No reason or warning given - that can't be good IT practice right? I can't get evolution working with groupwise, and they only allow access to the server from within the uni network anyway. Outside access is a web mail interface which is OK for travelling, but not every day. My solution is to set up a rule that forwards all mail to another email account, then get Mutt to set the reply address to my uni one. If I edit the headers of the forwarded mail, the messages then look like the originals (not forwarded from me). I'm thinking of setting something up in my .procmailrc that strips those headers related to the forwarding of the message, so they look sensible when delivered. Would sed or awk be the best way to deal with this? Any ideas? It seems extreme to go to these lengths, but the university seems to have taken an extreme policy on mail that has effectively shut me out from using the mail dream team I'm used to... Denis Crowdy -- Department of Contemporary Music Studies Macquarie University NSW 2109, Australia +61 2 9850 6787; http://www.dcms.mq.edu.au -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: WAS - Re: [SLUG] Your top-ten linux desktop apps
On Tue, Oct 04, 2005 at 12:28:51PM +1000, Matthew Hannigan wrote: > http://www.eskimo.com/~scs/C-faq/q2.13.html A better link, to the whole faq is http://www.faqs.org/faqs/C-faq/faq/ What's remarkable is the amount of space in the faq devoted to exactly the issues mentioned in this thread. -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: WAS - Re: [SLUG] Your top-ten linux desktop apps
On Mon, Oct 03, 2005 at 07:44:44PM -0500, [EMAIL PROTECTED] wrote: > k, I am a newb, so someone plz quickly explain to me why the variable > 'initial' > takes 2 bytes, 'birthdate' takes 4 bytes but the struct which is 2+4 = 6 > bytes > takes 8 bytes? http://www.eskimo.com/~scs/C-faq/q2.13.html -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
[SLUG] Driver query
Anyone able to confirm if the Dvico Fusion HDTV card drivers are now merged into recent 2.6 kernels? ie. no need to grab the files and compile into a kernel. About to embark on playing around with one and all the howtos I have found are out dated, so was wanting to confirm if the process about the driver can be skipped. I was thinking of trying to use a recent version of Kubuntu just for the sake of it, as I want to confirm if Mythtv is remotely usefull to me after all, and if so, should i get some new hardware to run it. etc. Thanks -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] Portfw: iptables or tcp proxies
On Tue, 2005-10-04 at 08:10 +1000, Carlo Sogono wrote: > We have been using tcp proxies (simpleproxy/tcpproxy) to forward ports > from our firewall to internal machines. Recently I have changed this > setup to regular iptables port forwarding. My understanding is that > since tcp proxies are daemons that accept connections from the > Internet and make connections to internal IPs, they would be a lot > slower than iptables (kernel-level routing?). Are there any advantages > to running tcp proxies instead of using port forwarding? That's a hard question in general. One thing that a "TCP proxy" does is to ACK packets as soon as they get to the router, rather than when they reach their endpoint. This is a desirable property if your gateway forwards to a high-throughput but also high-latency link (satellite for example). It does break TCP semantics though. TCP layer proxies are also able to insulate your network from "broken TCP packets". The problem is that unless you run a well-written TCP proxy, you then open up your firewall to attack. If you're just using this to forward to SSH, then I'd be using packet-forwarding. If it's web, I'd probably run Squid or similar in front of your web-server. But straight "TCP proxies" don't offer that many benefits on their own unless you have very specialised needs (assuming you keep your kernels patched on the machines in your network). HTH, James. -- "Now, there are no problems – only opportunities. However, this seemed to be an insurmountable opportunity." - http://www.surfare.net/~toolman/temp/diagram.html signature.asc Description: This is a digitally signed message part -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: WAS - Re: [SLUG] Your top-ten linux desktop apps
[EMAIL PROTECTED] wrote: #include struct verify { char initials[2]; int birthdate; }; int main(void) { struct verify holes; printf ("%d\n", sizeof(holes.initials[0])); printf ("%d\n", sizeof(holes.initials)); printf ("%d\n", sizeof(holes.birthdate)); printf ("%d\n", sizeof(holes)); return 0; } Given that the word-byte In 16-bit computer = 2 bytes word the output is, 1 2 2 4 in 32-bit computer = 4 bytes word the output is, 1 2 4 8 k, I am a newb, so someone plz quickly explain to me why the variable 'initial' takes 2 bytes, 'birthdate' takes 4 bytes but the struct which is 2+4 = 6 bytes takes 8 bytes? You refer to 32-bit intel computer in the above illustration. Our compiler allocates, the start of struct at the word alignment and memory must be contiguous. So, 2 characters = initials is started at the beginning of a word byte and our word byte = 4 bytes. But only the first 2 bytes are taken because we have only two characters. The last two bytes in the 'word' are empty. When the compiler continued on to allocate memory for the next object in the struct, which in this case is int, this is allocate memory beginning at the next word byte by skipping the two empty bytes. So, 2 char + 2 empty + 4 bytes = 8 bytes. The is the struct itself and has 8 bytes. -- O Plameras http://www.acay.com.au/~oscarp/tutor -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: WAS - Re: [SLUG] Your top-ten linux desktop apps
On Mon Oct 03, 2005 at 19:44:44 -0500, [EMAIL PROTECTED] wrote: > >>#include >>struct verify { >>char initials[2]; >>int birthdate; >>}; >>int main(void) >>{ >>struct verify holes; >>printf ("%d\n", sizeof(holes.initials[0])); >>printf ("%d\n", sizeof(holes.initials)); >>printf ("%d\n", sizeof(holes.birthdate)); >>printf ("%d\n", sizeof(holes)); >>return 0; >>} >>Given that the word-byte >>In 16-bit computer = 2 bytes word the output is, >>1 >>2 >>2 >>4 >>in 32-bit computer = 4 bytes word the output is, >>1 >>2 >>4 >>8 > > >k, I am a newb, so someone plz quickly explain to me why the variable >'initial' >takes 2 bytes, 'birthdate' takes 4 bytes but the struct which is 2+4 = 6 >bytes >takes 8 bytes? > See my last email, but it is likely that in memory it is layed out as: [ char(1) | char(1) | padding(2) | int(4) ] So there is two bytes of padding after the characters to make sure the integer is aligned. Having the integer aligned makes for a faster program (in general), at the expense of a nominal (in general) amount of memory. The compiler has done a space<->time trade off on your behalf. Benno -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: WAS - Re: [SLUG] Your top-ten linux desktop apps
On Tue Oct 04, 2005 at 10:15:49 +1000, O Plameras wrote: >Benno wrote: > >>On Sat Oct 01, 2005 at 18:23:40 +1000, O Plameras wrote: >> > >What do you mean ? Can you illustrate with C codes ? Do you mean that a >struct >are not allocated contiguous memory ? Do you mean a struct components are >allocated random memory. If it does not allocate contiguous memory in your >thinking, what about arrays since struct is similar to arrays except the >objects are >of mixed types ? > >And when struct components are allocated random memory, this breaks down >the >nature and the power of C which to my mind lie in its ability to >manipulate and >manage objects using pointers and pointer-arithmetic. What I mean is how the structure is layed out in memory is not defined by the specification, and is up to the C compiler, or rather give the implementation plenty of flexibility in the layout. so struct foo { char x; char y; int z; }; Could be layed out in memory as: (numbers in brackets refer to clause in C99 spec) [ x | y | z ] or possibly [ x padding | y padding | z ] (6.7.2.1.12) or more likely [ x | y | padding | z ] although it can't be [ y | x | z ] (6.7.2.1.13) and it also can't be: [ padding x | y | z] (6.7.2.1.13) """ #include #include struct foo { char x; int y; }; int main(void) { struct foo foo; printf("Offset of: x: %zd y: %zd\n", offsetof(struct foo, x), offsetof(struct foo, y)); if (sizeof(foo.x) == offsetof(struct foo, y)) printf("sizeof(foo.x) == offsetof(struct foo, y)\n"); else printf("sizeof(foo.x) != offsetof(struct foo, y)\n"); } """ Demonstrates this. For example compiling normally with gcc will output: Offset of: x: 0 y: 4 sizeof(foo.x) != offsetof(struct foo, y) compiling with -fpack-struct results in: Offset of: x: 0 y: 1 sizeof(foo.x) == offsetof(struct foo, y) As far as I know: struct foo; struct foo a[]; &(a[1]) == ((uintptr_t) &a[0]) + sizeof(struct foo); (6.5.6.9 footnote 88) >>Matthew said is wasn't `necessarily' bound to the hardware. In practise you >>are going to see different data type sizes on different bits of hardware. >>But just because the hardware can store an 64-bit words, doesn't mean that >>the ABI is going to specify an int to be 64-bit. >> >> >What you probably mean is it is not mandated by the standard. Some specs >are mandated >and some are not. Thats exactly what I mean. The C99 specification does not mandate the size of types. The platform (that is OS + architecture) usually defines an ABI which compilers should use. It does (usually) specifiy the size of the types. >That's why I used specific C codes to illustrate. Whether the C codes >that I used follows >the standard in the sense that it does not violate the standard it is >compliant. After all >compliance means it does not violate mandated standards. > >And in intel or amd 16-bit and 32-bit it is as demonstrated. That's what >I meant. What you provided is compliant C, however making any assumption on the underlying bus speed, hardware word size, based on the size of an integer is just not going to work, which appears to be what you are trying to say. There is no specified relationship between hardware word size and sizeof(int). In some ABI hwardware word size == sizeof(int), (ia32, some 16bit processors, VAX maybe) and in others hardward word size != sizeof(int) (amd64, itanium, power4). Benno -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: WAS - Re: [SLUG] Your top-ten linux desktop apps
#include struct verify { char initials[2]; int birthdate; }; int main(void) { struct verify holes; printf ("%d\n", sizeof(holes.initials[0])); printf ("%d\n", sizeof(holes.initials)); printf ("%d\n", sizeof(holes.birthdate)); printf ("%d\n", sizeof(holes)); return 0; } Given that the word-byte In 16-bit computer = 2 bytes word the output is, 1 2 2 4 in 32-bit computer = 4 bytes word the output is, 1 2 4 8 k, I am a newb, so someone plz quickly explain to me why the variable 'initial' takes 2 bytes, 'birthdate' takes 4 bytes but the struct which is 2+4 = 6 bytes takes 8 bytes? -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Was Re: [SLUG] C-Pointers and Perl ? Now Explain Certain Mesg Log
O Plameras wrote: I can use 'dmesg' to check the log done by my module by a #dmesg hello: module license 'unspecified' taints kernel. Hello world 1. The message "...:module license 'unspecified' taints kernel" baffles many new users of linux. So, this is just to say that I did not specify that my lincense is GPL or similar. If I had done this the message will not appear. Incidentally, some real device drivers produce this log message when loaded. This means that when there is a problem with that device driver do not go to linux developer or the linux list to report the problem. Go to the supplier. -- O Plameras http://www.acay.com.au/~oscarp/tutor -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
[SLUG] October Sydpug meeting on multimaster replication for PostgreSQL
Hi all, The October meeting of Sydpug will be held on the 4th of October at the James Squire Brew House[1] from 6:30pm. I will be speaking about the technology behind Slony 2, a multimaster replication system for PostgreSQL which I am currently prototyping. This will be the first public overview of Slony 2, so anyone interested in database scalability and replication should come along and see just how innovative open source software has the potential to be. More information can be found here: http://pugs.postgresql.org/sydpug/archives/42.html Thanks, Gavin -- [1] http://www.malt-shovel.com.au/brewhouse.asp?Sydney=true -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
[SLUG] AUUG 2005 (Sydney) conference update
This is the first in a series of previews of AUUG 2005 - The Conference for Unix, Linux and Open Source Professionals. This week we are highlighting guest speaker Peter Gutmann. Peter is a researcher in the Department of Computer Science at the University of Auckland, where his research interests cover the design and analysis of security techniques and systems. A self-confessed professional paranoid, he helped write the popular PGP encryption package, has authored a number of papers and RFC's on security and encryption including the X.509 Style Guide for certificates, and is the author of the open source Cryptlib security toolkit. In his spare time he pokes holes in whatever security systems and mechanisms catch his attention and grumbles about PKIs. Peter will be presenting two papers at AUUG 2005 - one on the Cryptlib security toolkit and another on Sustainable Open Source Software Development. For more details on AUUG 2005 visit http://www.auug.org.au Please note that early-bird registration has been extended to this coming Friday (September 30) I look forward to seeing you at AUUG 2005! -- footnote --- The monthly SLUG meeting has also been moved to Friday October 21st and happens just after AUUG and is about 5 minutes walk away. -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: WAS - Re: [SLUG] Your top-ten linux desktop apps
Benno wrote: On Sat Oct 01, 2005 at 18:23:40 +1000, O Plameras wrote: Matthew Hannigan wrote: On Fri, Sep 30, 2005 at 10:09:40AM +1000, O Plameras wrote: and as C is closely bound to hardware architecture you must have said something about these data Actually, C is not necessarily that closely bound to hardware architecture. The the following C program illustrates the relationship of C and hardware architecture on 16-bit and 32-bit (Two different architectures). We cannot use 32-bit and 64-bit (AMD) to illustrate because the int size are the same in both. This is an aberration for AMD CPUs, I think. Many documentations says that a 64-bit should really have int size=8 instead of 4 (see http://www.osdata.com/topic/language/asm/datarep.htm -DEC VAX *16* *bit* [2 *byte*] *word*; 32 bit [4 *byte*] longword; 64 bit [8 *byte*]quadword; 132 bit [16 *byte*] octaword; data may be unaligned at a speed penalty *...* ) There are other documentations similar to the above assertions on the net. It depends on the architecture ABI. As others have shown AMD64, Itanium, (and I'm pretty sure power5) architectures use 32-bit ints. Otehr 64-bit architectures may choose differently. But check the C-codes. #include struct verify { char initials[2]; int birthdate; }; int main(void) { struct verify holes; printf ("%d\n", sizeof(holes.initials[0])); printf ("%d\n", sizeof(holes.initials)); printf ("%d\n", sizeof(holes.birthdate)); printf ("%d\n", sizeof(holes)); return 0; } Given that the word-byte In 16-bit computer = 2 bytes word the output is, 1 2 2 4 in 32-bit computer = 4 bytes word the output is, 1 2 4 8 Two things are different due to computer architecture. 1. The same struct have different memory sizes allocated. Yep. 2. The struct has no hole in 16-bit and has 2-byte hole in 32-bit because C-compiler always align int data types beginning at the next word byte. I don't think the C standard specifies how a struct should be layed out in memory. What do you mean ? Can you illustrate with C codes ? Do you mean that a struct are not allocated contiguous memory ? Do you mean a struct components are allocated random memory. If it does not allocate contiguous memory in your thinking, what about arrays since struct is similar to arrays except the objects are of mixed types ? And when struct components are allocated random memory, this breaks down the nature and the power of C which to my mind lie in its ability to manipulate and manage objects using pointers and pointer-arithmetic. Matthew said is wasn't `necessarily' bound to the hardware. In practise you are going to see different data type sizes on different bits of hardware. But just because the hardware can store an 64-bit words, doesn't mean that the ABI is going to specify an int to be 64-bit. What you probably mean is it is not mandated by the standard. Some specs are mandated and some are not. That's why I used specific C codes to illustrate. Whether the C codes that I used follows the standard in the sense that it does not violate the standard it is compliant. After all compliance means it does not violate mandated standards. And in intel or amd 16-bit and 32-bit it is as demonstrated. That's what I meant. -- O Plameras http://www.acay.com.au/~oscarp/tutor -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] C-Pointers vs Perl 6 - will this thread ever die?
On 10/3/05, Mark Johnathan Greenaway <[EMAIL PROTECTED]> wrote: > On Mon, Oct 03, 2005 at 08:42:17PM +1000, O Plameras wrote: > > Ok, I'd like to learn another High Level Language, specifically perl6. > > And I'd like to make a living from it. > > I'd like to write a Linux Version 2.6 kernel module.(Linux Version 2.4 > > kernel is different.) > > This is quite easy with C-language should I do it. As an illustration I > > have a very simple > > kernel module for Linux V2.6. as follows: > *example code snipped* > > Simple with C, isn't it ? How can I do this in Perl6 ? > > This example is ludicrously contrived. For kernel modules, I think C is > probably the superior choice. However, the measure of a programming > language shouldn't be whether you can write kernel modules in it > effectively unless that is the sole programming task that is important > to you. And unless you're a paid kernel developer, I'd sincerely hope > that you don't write the majority of your code to run in kernelspace - > the seperation between the kernel's memory space and the user memory > space exists for a very good reason. It's not about being a superior choice in comparison with Perl 6. It's that you really *can't* write a module using the language (not for Linux, and not for any Unix I know). Unless somebody comes up with a kernel hook to a Perl interpreter (or embed Perl in it, which would be crazy to say the least), it won't be possible, ever. So it's beyond opinion. It seems to me Oscar was showing how simple it is to write a LKM. Now, no matter how simpler/shorter/more efficient your code would be when using Perl, in this particular case, it's pointless. As it's pointless to use Python, bash, or whatever interpreted language for that, simply because there's no interpreter in the kernel, for obvious reasons. > > -- > Mark > -- > SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ > Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html > -- Julio C. Ody http://rootshell.be/~julioody -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
[SLUG] C-Pointers vs Perl 6 - will this thread ever die?
On Mon, Oct 03, 2005 at 08:42:17PM +1000, O Plameras wrote: > Ok, I'd like to learn another High Level Language, specifically perl6. > And I'd like to make a living from it. > I'd like to write a Linux Version 2.6 kernel module.(Linux Version 2.4 > kernel is different.) > This is quite easy with C-language should I do it. As an illustration I > have a very simple > kernel module for Linux V2.6. as follows: *example code snipped* > Simple with C, isn't it ? How can I do this in Perl6 ? This example is ludicrously contrived. For kernel modules, I think C is probably the superior choice. However, the measure of a programming language shouldn't be whether you can write kernel modules in it effectively unless that is the sole programming task that is important to you. And unless you're a paid kernel developer, I'd sincerely hope that you don't write the majority of your code to run in kernelspace - the seperation between the kernel's memory space and the user memory space exists for a very good reason. -- Mark -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] Re: iim-xbe freezing firefox?
I did a bit of quick research on google, and hopefully some of the following will help you. I'm pretty sure that iim-xbe part of the iiimf group of packages that provide an internationalization input method framework. I'm guessing that you might have done an 'Install everything' install of FC4, and as such you've been given all the iiimf packages. For a possible fix, i'd suggest you remove the iiimf packages on your system, restart X, and see if you get the same problem. An 'rpm -qa |grep iiimf' will turn up any iiimf packages on your system. On the other hand you might want i18n input, so this won't help you all that much at all. :-) If anything, it might be more of a fedora bug than a firefox one, so you might want to check on the fedora bug tracker. Best of luck, Lindsay Martin Ellison wrote: As discussed at the meeting, I have raised this on bugzilla.mozilla.org: https://bugzilla.mozilla.org/show_bug.cgi?id=310645 On Tue, 2005-09-27 at 19:04 +1000, Martin Ellison wrote: For some reason a process called iim-xbe is freezing firefox. Does anyone know why, how, or how to fix it? I find that after booting firefox is ok for several seconds and then freezes and goes 'not responding'. If I get into the system monitor and kill this iim-xbe process before this happens, firefox is fine. System is FC4 at current patch levels (yum update). Everything was fine under FC3 but this behaviour started when I upgraded to FC4 and has persisted. uname -a Linux glerk 2.6.12-1.1456_FC4 #1 Thu Sep 22 02:11:40 EDT 2005 i686 i686 i386 GNU/Linux -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
[SLUG] Portfw: iptables or tcp proxies
We have been using tcp proxies (simpleproxy/tcpproxy) to forward ports from our firewall to internal machines. Recently I have changed this setup to regular iptables port forwarding. My understanding is that since tcp proxies are daemons that accept connections from the Internet and make connections to internal IPs, they would be a lot slower than iptables (kernel-level routing?). Are there any advantages to running tcp proxies instead of using port forwarding? Carlo -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] C-Pointers and Perl ?
On Sun Oct 02, 2005 at 22:50:17 +1000, [EMAIL PROTECTED] wrote: >On Fri, Sep 30, 2005 at 09:26:45AM +1000, Benno wrote: >> I know, but I don't agree with him. If the language is good, there is no >> reason why it *shouldn't* be used for device driver programming. >> >> Device drivers are, in general, buggy pieces of crap, so having a higher >> level language to program them in would be a *really* good thing. > >Remember that when you are coding to hardware, half the "program" is >invisible and out of your control (out of the compiler's control too). >Half the program that you are building is the hardware itself, >it is an active component, not a chunk of memory. The hardware does >things and you have to also do things in the right sequence, at the >right time. Often the device driver code is perfectly correct, it just >doesn't perfectly match your particular bit of hardware. Either one >manufacturer has copied another manufacturer and got it wrong or >the driver was written for an older version of the card and the new >cards changed behaviour (but the manufacturer never told anyone) or >the driver was written to reverse engineered specifications and no >one really knows what the hardware is doing anyhow. Sure, but those things shouldn't cause the driver to crash. They might cause it to fail, but that is a completely different story. And of course the device itself might do some bad write to memory. (If we had I/O TLBs of course this would be less of an issue.) In any case, even taking in to account all those problems, device drivers are still, in general, buggy pieces of crap. This is why there is attention within m$ on the SLAM project, and project like Nooks on linux, to mitigate the problems with device drivers. >> I've written bindings to allow you to program drivers in python >> before, unfortunately the result wastoo slow :(. > >Timing is actually part of your program when you write device drivers. Less so than you might imagine on things like IDE. >> So a higher level >> compiled language like O'Caml might be kind of cool. > >In theory, it sounds good. You hit a big snag when you look at what >makes "functional" languages work, which is that each whole unit >of code has well defined inputs and outputs and the behaviour of >that code-unit does not depend on influences outside the scope of >those well defined inputs and outputs. It's a nice mathematical >approach, but once you put a piece of hardware into the mix, half >the program becomes invisible and out of your control (i.e. the >hardware half). The "functional" paradigm starts to break down because >any bit of code that touches a hardware register is now capable of >behaviour that the compiler doesn't understand. > >Functional languages are good for transforming a well defined input >into a well defined output. They don't handle "real world" messiness >very well. Most functional languages have a way to escape this in a well defined manner. In any case, I'm not advocating everyone should be start writing drivers in C. In fact I'm going to keep writing drivers in C because it is still current state of the art. What I am saying is there are plenty of problems that you encounter when using C, and trying to use a higher level language, such as O'Caml, to see where some of the complexity can be taken care of by the language is an interesting research topic. In the end it might be totally useless for it, but I don't think you can know that until trying it, and more importantly finding out the specific reasons why it is good/bad is the interesting part. Benno -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: WAS - Re: [SLUG] Your top-ten linux desktop apps
On Sat Oct 01, 2005 at 18:23:40 +1000, O Plameras wrote: >Matthew Hannigan wrote: > >>On Fri, Sep 30, 2005 at 10:09:40AM +1000, O Plameras wrote: >> >> >>> and as C is closely bound >>>to hardware architecture you must have said something about these data >>> >>> >> >>Actually, C is not necessarily that closely bound to hardware architecture. >> >> >> >The the following C program illustrates the relationship of C and >hardware architecture on >16-bit and 32-bit (Two different architectures). We cannot use 32-bit >and 64-bit (AMD) to >illustrate because the int size are the same in both. This is an >aberration for AMD CPUs, I >think. > >Many documentations says that a 64-bit should really have int size=8 >instead of 4 > >(see http://www.osdata.com/topic/language/asm/datarep.htm >-DEC VAX *16* *bit* [2 *byte*] *word*; 32 bit [4 *byte*] longword; 64 >bit [8 *byte*]quadword; >132 bit [16 *byte*] octaword; data may be unaligned at a speed penalty *...* >) > >There are other documentations similar to the above assertions on the net. It depends on the architecture ABI. As others have shown AMD64, Itanium, (and I'm pretty sure power5) architectures use 32-bit ints. Otehr 64-bit architectures may choose differently. >But check the C-codes. > >#include >struct verify { > char initials[2]; > int birthdate; >}; >int main(void) >{ > struct verify holes; > printf ("%d\n", sizeof(holes.initials[0])); > printf ("%d\n", sizeof(holes.initials)); > printf ("%d\n", sizeof(holes.birthdate)); > printf ("%d\n", sizeof(holes)); > return 0; >} >Given that the word-byte >In 16-bit computer = 2 bytes word the output is, >1 >2 >2 >4 >in 32-bit computer = 4 bytes word the output is, >1 >2 >4 >8 > >Two things are different due to computer architecture. >1. The same struct have different memory sizes allocated. Yep. >2. The struct has no hole in 16-bit and has 2-byte hole in 32-bit >because C-compiler always > align int data types beginning at the next word byte. I don't think the C standard specifies how a struct should be layed out in memory. Matthew said is wasn't `necessarily' bound to the hardware. In practise you are going to see different data type sizes on different bits of hardware. But just because the hardware can store an 64-bit words, doesn't mean that the ABI is going to specify an int to be 64-bit. Benno -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] Keeping passwords safe
On Mon, 2005-10-03 at 22:57 +1000, Erik de Castro Lopo wrote: > Mike MacCana wrote: > > > openssl can do this easily. > > It can? How? Its certainly not obvious from the man page. Try "man enc". From that manpage: Encrypt a file using triple DES in CBC mode using a prompted password: openssl des3 -salt -in file.txt -out file.des3 Decrypt a file using a supplied password: openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword Cheers, Ben Ben Stringer = [EMAIL PROTECTED] == -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] Keeping passwords safe
Jeff Waugh wrote: > > > > Does anybody have any recomendations for a program that can be used to > > store passwords, bank account details etc in an encrypted file? > > You're going to smack me for this, but... gpg? :-) Hmmm. Yes probably. One of the things I'd like to keep in the encypted file is my gpg key and revocation certificate. Erik -- +---+ Erik de Castro Lopo +---+ "If POSIX threads are a good thing, perhaps I don't want to know what they're better than." -- Rob Pike -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] Keeping passwords safe
Mike MacCana wrote: > openssl can do this easily. It can? How? Its certainly not obvious from the man page. Erik -- +---+ Erik de Castro Lopo +---+ "It is grossly irresponsible to connect a Windows machine directly to the net. ;-)" -- John Wiltshire on the Sydney Linux User Group mailing list -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] C-Pointers and Perl ?
O Plameras wrote: Angus Lees wrote: But you are choosing awkward examples around trivial numerical operations. Basic numeric operations and branching are things C can do quite easily (provided the numbers fit within C's types). Try common coding needs that C can't handle easily, like string manipulation or memory management during error recovery. Oscar, I suggest you actually use a high level language for a while and then try going back to C. Doing anything in C (or even java for that matter) is just so much tedious typing. Ok, I'd like to learn another High Level Language, specifically perl6. And I'd like to make a living from it. I'd like to write a Linux Version 2.6 kernel module.(Linux Version 2.4 kernel is different.) This is quite easy with C-language should I do it. As an illustration I have a very simple kernel module for Linux V2.6. as follows: /* * hello.c - The simplest kernel module. */ #include #include int init_module(void) { printk(KERN_INFO "Hello world.\n"); return 0; } void cleanup_module(void) { printk(KERN_INFO "Goodbye world.\n"); } My Makefile is as follows: obj-m += hello.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules I do, # make # insmod hello.ko # lsmod(I check that my hello module is loaded.) I can use 'dmesg' to check the log done by my module by a #dmesg hello: module license 'unspecified' taints kernel. Hello world 1. # rmmod hello.ko (I unload my hello module) #dmesg hello: module license 'unspecified' taints kernel. Hello world 1. Goodbye world 1. And I got things working and perhaps I get paid for the job. Simple with C, isn't it ? How can I do this in Perl6 ? -- O Plameras http://www.acay.com.au/~oscarp/tutor -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
[SLUG] K Mail Listing
Hell Sluggers.. I wanted to be able to capture the list of email that has been sent and received from my mail box. Do I go into the temp file and do a cat > filename.tax? How does one translate the email list to a data base for say billing purposes. Thanks in advance.. Cheers, Nick. -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] C-Pointers and Perl ?
Angus Lees wrote: But you are choosing awkward examples around trivial numerical operations. Basic numeric operations and branching are things C can do quite easily (provided the numbers fit within C's types). Try common coding needs that C can't handle easily, like string manipulation or memory management during error recovery. Oscar, I suggest you actually use a high level language for a while and then try going back to C. Doing anything in C (or even java for that matter) is just so much tedious typing. Ok, I'd like to learn another High Level Language, specifically perl6. And I'd like to make a living from it. I'd like to write a Linux Version 2.6 kernel module.(Linux Version 2.4 kernel is different.) This is quite easy with C-language should I do it. As an illustration I have a very simple kernel module for Linux V2.6. as follows: /* * hello.c - The simplest kernel module. */ #include #include int init_module(void) { printk(KERN_INFO "Hello world.\n"); return 0; } void cleanup_module(void) { printk(KERN_INFO "Goodbye world.\n"); } My Makefile is as follows: obj-m += hello.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules I do, # make # insmod hello.ko # lsmod(I check that my hello module is loaded.) # rmmod hello.ko (I unload my hello module) And I got things working and perhaps I get paid for the job. Simple with C, isn't it ? How can I do this in Perl6 ? -- O Plameras http://www.acay.com.au/~oscarp/tutor -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] Wireless broadband -Linux friendly modems/providers
On Mon, Oct 03, 2005 at 04:08:05PM +1000, Mark O'Connor wrote: > ?I am considering using wireless broadband and wondered if anyone had any > experience with the Sydney providers and Linux compatibility? > > Is the client/login software on the wireless modem ( controlled by a > browser) or do I need a client for my Debian box. > > Any preferred service providers? > Thanks > Mark I set up my daughter on Unwired/OSX and it's a piece of cake. It uses simple DHCP/ethernet, so any OS or distro will work, even windows. They supply a CD but on OSX at least it's easier and quicker to set it up manually. All you need is the modem and your credit card :-) Be careful about signal though. My daughter is supposed to be in a good area, but she has to tape her modem to the window in the front room or it won't work. At least you can return the modem in the grace period if it doesn't work. I assume that other providers are similar, but I've no experience. -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html