LWN.net Logo

Android source available

Android source available

Posted Oct 22, 2008 8:02 UTC (Wed) by johill (subscriber, #25196)
Parent article: Android source available

There's little, if no, value in this code. Here's a select snippet:

        fd = open("/dev/mem", O_RDWR | O_SYNC);
        if( fd == -1 ) {
            print_error("Cannot access /dev/mem\n");
            goto init_driver_end;
        }
        nvsPtr = (volatile unsigned long *)mmap(0,0x1000,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0x13F13000);
        eeprom_image_length = *(nvsPtr + (0xE0C >> 2));
        print_debug("---Eeprom from Memory Size = %u\n", eeprom_image_length);
or how about kernel code that is licensed under "Apache License, Version 2.0" which is clearly incompatible with the GPL2...


(Log in to post comments)

Android source available

Posted Oct 22, 2008 8:15 UTC (Wed) by johill (subscriber, #25196) [Link]

I stand corrected, the apache 2 license code I found was some userspace tool. Not that the kernel code is any decent quality so that it would be suitable for merging without complete rewriting.

Fastest review ever

Posted Oct 22, 2008 10:43 UTC (Wed) by avik (guest, #704) [Link]

"There's little, if no, value in this code"

This has to be the fastest review I've ever seen of a 2.1GB code base. I'm sure you wouldn't like your own code to be dismissed out of hand like this; please show more respect towards others'.

Android source available

Posted Oct 22, 2008 13:18 UTC (Wed) by busterb (subscriber, #560) [Link]

This code is useful in the following ways:

1. Now we know where the eeprom is in the memory map of a G1 phone, its size and as well at
least one of its elements.

2. I've know a few embedded developers who try to write an IOCTL-driven character device to
access the most trivial one-off hardware. Here, we can see the Android developers are at least
pragmatic about embedded development. Maybe some embedded developer will finally slap his
head and say 'of course - why was I going to all that trouble with /dev/eeprom when /dev/mem
was just as useful'

3. This code obviously has to run as root - somebody can audit the code now for security
problems.

Android source available

Posted Oct 23, 2008 12:58 UTC (Thu) by ikm (subscriber, #493) [Link]

> init_driver_end;

I presume that code is a part of some userspace driver. As such, what is exactly wrong working directly with /dev/mem? If I remember correctly, the approach of userspace drivers is an officially blessed practice and is actually recommended for embedded developers.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds