1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD><TITLE> Linux Gazette Table of Contents LG #94</TITLE></HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
ALINK="#FF0000" >
<center>
<!-- A HREF="http://www.linuxgazette.com/">
<H1><IMG SRC="../gx/newlogo.jpg" ALT="LINUX GAZETTE" border="0"></H1></A> -->
<A HREF="http://www.linuxgazette.com/">
<H1><IMG ALT="LINUX GAZETTE" SRC="../gx/lglogo.png"
WIDTH="600" HEIGHT="124" border="0"></H1></A>
<H2>September 2003, Issue 94
Published by <I>Linux Journal</I></H2>
<A HREF="../index.html">Front Page</A> |
<A HREF="../index.html">Back Issues</A> |
<A HREF="../lg_faq.html">FAQ</A> |
<A HREF="../mirrors.html">Mirrors</A> <!-- | --><BR>
<A HREF="../tag-kb.html">The Answer Gang knowledge base</A> (your Linux questions here!) <!-- | --><BR>
<A HREF="http://www.linuxgazette.com/search.html">Search (www.linuxgazette.com)</A>
<!-- *** BEGIN mirror site search link *** -->
<!-- <A HREF="http://www.linuxgazette.com/search.html">(SITE.COM
mirror)</A> -->
<!-- *** END mirror site search link *** -->
</CENTER>
<HR NOSHADE>
<!--=================================================================-->
<!-- H1><font color="#BB0000">Table of Contents:</font></H1 -->
<!-- *** BEGIN toc *** -->
<UL>
<LI> <A HREF="lg_bytes.html">News Bytes</A>, <EM>by Michael Conry</EM>
<LI> <A HREF="ecol.html">Ecol</A>, <EM>by Javier Malonda</EM>
<LI> <A HREF="ramankutty.html">From C To Assembly Language</A>, <EM>by Hiran Ramankutty</EM>
<LI> <A HREF="kolp.html">Play Encoded DVDs in Xine</A>, <EM>by LeaAnne Kolp</EM>
<LI> <A HREF="lalji.html">Under /etc (A Simple Guide)</A>, <EM>by AmirAli Lalji</EM>
<LI> <A HREF="yan-fa.html">Linux based Radio Timeshifting</A>, <EM>by Yan-Fa Li</EM>
<LI> <A HREF="zhuralev.html">USENET groups, email, and ssh tunnels over dial-up connection</A>, <EM>by Nokolay Zhuralev</EM>
<LI> <A HREF="hughes.html">Python Weather Station</A>, <EM>by Phil Hughes</EM>
<LI> <A HREF="anonymous.html">SCO Interview</A>, <EM>by Anonymous</EM>
</UL>
<!-- *** END toc *** -->
<HR NOSHADE>
<!--=================================================================-->
<H3 ALIGN="center"><EM>Linux Gazette</EM> Staff and The Answer Gang</H3>
<BLOCKQUOTE>
<STRONG>TAG Editor:</STRONG> Heather Stern<BR>
<STRONG>Senior Contributing Editor:</STRONG> Jim Dennis<BR>
<STRONG>Contributing Editors:</STRONG>
Ben Okopnik, Dan Wilder, Don Marti
</BLOCKQUOTE>
<HR NOSHADE>
<!--=================================================================-->
<A HREF="TWDT.txt.gz">TWDT 1 (gzipped text file)</A><BR>
<A HREF="TWDT.html">TWDT 2 (HTML file)</A><BR>
are files containing the entire issue: one in text format, one in HTML.
They are provided
strictly as a way to save the contents as one file for later printing in
the format of your choice;
there is no guarantee of working links in the HTML version.
<HR NOSHADE>
<!--=================================================================-->
<center>
<I>Linux Gazette</I><img alt="[tm]" src="../gx/tm.gif">,
<A HREF="http://www.linuxgazette.com/">http://www.linuxgazette.com/</A><BR>
This page maintained by the Webmaster of <I>Linux Gazette</I>,
<A HREF="mailto: webmaster@linuxgazette.com"> webmaster@linuxgazette.com</A>
<P>
<H5>Copyright © 1996-2003 Specialized Systems Consultants, Inc.</H5>
</center>
<HR NOSHADE>
<!--=================================================================-->
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">News Bytes</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/conry.html">Michael Conry</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
</p><center>
<table cellpadding="7"><tbody><tr><td>
<img src="../gx/bytes.gif" border="1" alt="News Bytes">
</td><td>
<h3>Contents:</h3>
<ul>
<li><a href="#leg">Legislation and More Legislation</a>
</li><li><a href="#links">Linux Links</a>
</li><li><a href="#conferences">Conferences and Events</a>
</li><li><a href="#general">News in General</a>
</li><li><a href="#distro">Distro News</a>
</li><li><a href="#commercial">Software and Product News</a>
</li></ul>
</td></tr></tbody></table>
<strong>Selected and formatted by <a href="mailto:michael.conry@softhome.net">Michael Conry</a></strong>
</center>
<p> Submitters, send your News Bytes items in
<font size="+2"><strong>PLAIN TEXT</strong></font>
format. Other formats may be rejected without reading. You have been
warned! A one- or two-paragraph summary plus URL gets you a better
announcement than an entire press release. Submit items to
<a href="mailto:gazette@ssc.com">gazette@ssc.com</a>
</p><hr> <p>
<!-- =================================================================== -->
</p><h3><img alt=" " src="../gx/bolt.gif">
<font color="green">
September 2003 <i>Linux Journal</i>
</font>
</h3>
<img alt="[issue 113 cover image]" src="misc/bytes/lj-cover113.png" width="200" height="268" align="left" hspace="20">
The September issue of <a href="http://www.linuxjournal.com/"><i>Linux
Journal</i></a> is on newsstands now.
This issue focuses on Community Networks. Click
<a href="http://www.linuxjournal.com/modules.php?op=modload&name=NS-lj-issues/issue113&file=index">here</a>
to view the table of contents, or
<a href="http://www.linuxjournal.com/subscribe/">here</a>
to subscribe.
<p>
<font color="green">All articles in issues 1-102 are available for
public reading at
<a href="http://www.linuxjournal.com/magazine.php">http://www.linuxjournal.com/magazine.php</a></font>.
Recent articles are available on-line for subscribers only at
<a href="http://interactive.linuxjournal.com/">http://interactive.linuxjournal.com/</a>.
<BR CLEAR="all">
<!-- =================================================================== -->
<a name="leg"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Legislation and More Legislation</font></H3></center>
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">European Software Patents
</FONT>
</H3>
<P>
On the 1st of September 2003, the European Parliament will hold a vote
which may have very far reaching and long lasting effects on the software
industry and community within the European Union. The central issue being
addressed in this vote is the patentability of software. In the past,
there has been some vagueness in the attitude of
<a href="http://www.european-patent-office.org/">the European Patent
Office</a> towards the patenting of software. Although official
regulations appeared to make software, mathematics, algorithms and business
methods
<a href="http://swpat.ffii.org/analysis/epc52/index.en.html">
essentially unpatentable</a>, working practise in the EPO has been to
bypass the legal framework intended to constrain it and to allow such
innovations to be patented. The new directive on
<a href="http://europa.eu.int/comm/internal_market/en/indprop/comp/02-277.htm">
the patentability of computer-implemented inventions</a> is supposed to be
a measure aimed at resolving this confusion by regularising the rules
regarding patentability. However, what the EU blurb glosses over is that
the provisions in the new directive significantly alter the legislation
currently governing software patentability. Rather than vindicating the
existing legal situation, the legislation is being recast in the image of
the current operations of the EPO. This is strikingly borne out by some
research performed by the <a href="http://ffii.org/">FFII</a>. The FFII
intended to
<a href="http://swpat.ffii.org/papers/eubsa-swpat0202/tech/index.en.html">
show that the infamous "one click" Amazon.com patent</a> would be
acceptable under the proposed new regulations. During the course of these
investigations, it emerged that Amazon.com had <em>already</em>
<a href="http://swpat.ffii.org/news/03/amaz0818/index.en.html">
been granted a closely related patent</a> covering computerised methods of
gift delivery.
<P>
Of course, when considering these changes we must ask ourselves whether
perhaps these changes may be desirable. Though there are naturally those
who support the initiative, there is a very broad constituency that
strongly opposes this move towards European software patents. An
unscientific measure of the opposition to the software patent proposals can
be obtained by doing a
<a href="http://news.google.com/news?hl=en&edition=us&q=european+software+patents&btnG=Search+News">
search on Google News</a> for the terms "european software patents". The
vast majority of headlines are hostile or gloomy regarding the proposal.
There is a striking absence of outright support, all the more striking
given that this is a search of news outlets rather than personal or
lobby-group websites. This scepticism is
<a href="http://www.arnnet.com.au/index.php?id=1094595024&fp=16&fpid=0">
shared by many economists</a> who fear that the legal changes will lead to
a reduction in innovation and cutbacks in R&D expenditure. These fears
are felt very acutely among small and medium size software companies who
have perhaps the most to lose. Equally, open source developers may be left
<a href="http://swpat.ffii.org/#crn-gates030725">
in a vulnerable position</a> by these proposed changes. As has been seen
in the operation of software patents in the United States, the patent
system tends to work best for parties with large financial resources, such
as multinational corporations. Such deep pockets allow an organisation to
acquire a stock of patents, and then to defend the patents through the
courts. A well resourced holder of even a very spurious patent can thus
intimidate would-be competitors out of the market simply by virtue of the
differences in scale. The only group which will benefit to a greater
degree than large corporations is the legal fraternity.
<P>
It remains to be seen whether the protests and lobbying organised by
anti-patent groups will prove to be effective. Though actions such as
<a href="http://slashdot.org/articles/03/08/29/0510200.shtml?tid=155&tid=185&tid=99">
closing down websites</a> make an impact online, the real world effect can
be quite small. As was pointed out
<a href="http://www.theregister.co.uk/content/4/31472.html">
by the Register</a>, even though open source produces great code, it does
not necessarily produce great lobbying. The key for open-source groups
elsewhere and in the future is to share information about what works and
does not work in the political sphere, and to apply this information in
future struggles.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">SCO
</FONT>
</H3>
<P>
Writing an article on the SCO lawsuit(s) is getting steadily more difficult
as the volume of material on the subject mounts up. Much of it is simply
noise and it will not be until the case is dropped or reaches court that we
will have a chance to properly judge the true nature of SCO's plans. This
is especially true given SCO's reluctance to release any of the source code
they claim is infringing their "intellectual" property (the words "SCO" and
"intellectual" seem more mutually exclusive to me each day). Perhaps to
impress investors, SCO did deign to
<a href="http://slashdot.org/article.pl?sid=03/08/19/1523236&mode=nested&tid=106&tid=185">
display a couple of samples</a> at their annual reseller show. This was
very nice of them and illustrates why they should perhaps release more of
the "disputed" code. Analysis done
<a href="http://lwn.net/Articles/45019/">
by Linux Weekly News</a>
and
<a href="http://www.perens.org/SCO/SCOSlideShow.html">
by Bruce Perens</a>
indicated that the origination of the code was entirely legal and did not
infringe on SCO's property.
SCO spokesman Blake Stowell's
<a href="http://www.itworld.com/Man/2685/030819scocode/">
rather pointless response</a>
was to show a typically SCO-like disdain for facts and to assert that "at
this point it's going to be his [Perens'] word against ours".
Unfortunately for Blake, Perens' word is backed up by verifiable
documentation and historical record not to mention the fact that people who
worked on and remember the code are
<a href="http://slashdot.org/article.pl?sid=03/08/23/1731245&mode=nested&tid=123&tid=130&tid=185&tid=190&tid=99">
still alive</a>. Meanwhile, SCO's assertions are, at least
at this stage, no more than random bleatings.
<P>
Reaction to the SCO case has been mostly muted, though it is likely that
some more-cautious corporate types are somewhat reluctant to engage further
with Open Source and Free Software under the shadow of the court case. Few
though are likely to be so nervous as to stump up the licence fees
requested by SCO. The advice
<a href"http://www.idg.com.hk/cw/readstory.asp?aid=20030801018">
of Australian lawyer John Collins</a> sounds about right:
<blockquote>
"If you don't know whether or not you have a valid license because
there is uncertainty as to the providence of the software and who
actually owns the copyright, then to walk up and drop your pants to the
person who is likely to sue you sounds a little counter-intuitive and a
bit uncommercial,"
</blockquote>
<P>
Some have speculated that the true purpose of SCO's actions may be
connected to the (mostly positive) effect on its share price these
developments have had. An example of these arguments can be found in the
<a href="http://www.threenorth.com/sco/">
writings of Tim Rushing</a>, though ultimately everybody is still
speculating. Further analyses can be found
<a href="http://radio.weblogs.com/0120124/">
at GrokLaw</a>
and
<a href="http://sco.iwethey.org/">
at sco.iwethey.org</a>, though keeping up with the twists and turns, not to
mention the irrational behaviour of SCO execs, is rather taxing on the grey
matter.
<a name="links"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Linux Links</font></H3></center>
<P>
<a href="http://www.ActiveState.com">
ActiveState</a>
has
<a href="http://www.activestate.com/Corporate/Communications/Releases/Press1058851602.html">made freely available</a>
the
<a href="http://www.activestate.com/Products/PureMessage/Field_Guide_to_Spam/index.plex ">
ActiveState Field Guide to Spam</a>.
This is a living compilation of advanced
tricks used by spammers to hide their messages from spam filters.
<P>
Some links from
<a href="http://www.newsforge.com/">Newsforge</a>
<ul>
<li>
Thoughts on the legal implications of
<a href="http://newsforge.com/article.pl?sid=03/07/21/2118255">
personal music ownership</a>.
</li>
<li>
<a href="http://www.linuxquestions.org/questions/history/78090">
Interview with Asa Dotzler</a> of Mozilla.
</li>
<li>
VIA, SRI
<a href="http://newsvac.newsforge.com/article.pl?sid=03/07/31/1958230">
put Linux-based robots to the test</a>
at LinuxWorld Expo.
</li>
<li>
<a href="http://newsforge.com/article.pl?sid=03/07/29/1727249">
Host-based intrusion detection with samhain</a>.
</li>
<li>
Open Source is
<a href="http://newsforge.com/article.pl?sid=03/08/09/1355255">
good for the Philippine economy</a>.
</li>
<li>
<a href="http://newsvac.newsforge.com/article.pl?sid=03/08/10/0116204">
RubyForge open for business</a>
</li>
<li>
Jordi Carrasco-Munoz has
<a href="http://newsforge.com/article.pl?sid=03/08/14/1223235">
proposed a scheme for the pooling of ideas</a>.
</li>
<li>
TheLinux On Laptops
<a href="http://newsvac.newsforge.com/article.pl?sid=03/08/17/1344249">
Manufacturer Report Card has been updated</a>.
</li>
<li>
<a href="http://newsforge.com/article.pl?sid=03/08/20/1441247">
A new (egovernment) forge in town</a>
<em>Government Forge</em>.
</li>
</ul>
<P>
Some interesting links from the O'Reilly stable of websites:
<ul>
<li>
<a href="http://www.oreillynet.com/pub/a/network/synd/2003/08/05/closed_loop.html">
Introduction to Closed-Loop Control</a>
</li>
<li>
<a href="http://www.onlamp.com/pub/a/python/2003/08/14/gvr_interview.html">
Interview with Guido van Rossum</a>.
</li>
<li>
<a href="http://www.onlamp.com/pub/a/onlamp/2003/08/28/extremeprogramming.html">
Five lessons open source developers should learn from extreme
programming</a>.
</li>
</ul>
<P>
Ernie Ball guitar string company
<a href="http://news.com.com/2008-1082_3-5065859.html?tag=lh">
dumps Microsoft for Linux</a>
after BPA audit.
<P>
<a href="http://www.eweek.com/article2/0,3959,1227128,00.asp">
Linus says SCO is smoking crack</a>.
<P>
<a href="http://www.theregister.co.uk/">
The Register</a> reported on the launch of
Open Groupware.org, an application which claims to
<a href="http://www.theregister.co.uk/content/4/32119.html">
complete the OpenOffice productivity software set</a>.
<P>
Some links of interest from
<a href="http://www.linuxtoday.com/">
Linux Today</a>:
<ul>
<li>
Infoworld
<a href="http://www.infoworld.com/article/03/08/06/HNgplunenforceable_1.html">
report</a>
that the GPL <em>may</em> be unenforceable under German law.
</li>
<li>
A casual
<a href="http://articles.linmagau.org/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=238&page=1">
interview with the new Linux 2.6 kernel maintainer, Andrew Morton</a>.
</li>
<li>
V8 Supercar races in Australia feature
<a href="http://news.zdnet.co.uk/software/linuxunix/0,39020390,39115798,00.htm">
onboard Linux-based computers and wireless technology</a> to send
information on crashes to race officials.
</li>
<li>
Could free software development have an influence on society
<a href="http://www.canada.com/technology/story.html?id=5F7655EF-B9CD-4D28-919C-51AF3C9CBDC3">
like that exerted by the King James Bible</a>?
</li>
</ul>
<P>
Bruce Perens
<a href="http://www.perens.com/SCO/SCOSlideShow.html">
analyzes SCO's code samples</a> in detail.
<P>
<a href="http://www.debian.org/News/weekly/2003/31/">
Debian Weekly News highlighted</a>
an article by Ian Murdock arguing that
<a href="http://zdnet.com.com/2100-1107_2-5057755.html">
Linux is a process, not a product</a>.
<a name="conferences"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Upcoming conferences and events</font></H3></center>
<P> Listings courtesy <EM>Linux Journal</EM>. See <EM>LJ</EM>'s
<A HREF="http://www.linuxjournal.com/events.php">Events</A> page for the
latest goings-on.
<!-- *** BEGIN events table [this line needed by Linux Gazette events.py *** -->
<table cellpadding=5 border=0 width=100%>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>LinuxWorld UK</b><BR></TD>
<td valign=top>September 3-4, 2003<BR>Birmingham, United Kingdom<BR>
<a href="http://www.linuxworld2003.co.uk" target="_blank">
http://www.linuxworld2003.co.uk</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Linux Lunacy</b><BR><i>Brought to you by Linux Journal and
Geek Cruises!</i><br></TD>
<td valign=top>September 13-20, 2003<BR>Alaska's Inside Passage<BR>
<a href="http://www.geekcruises.com/home/ll3_home.html" target="_blank">
http://www.geekcruises.com/home/ll3_home.html</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Software Development Conference & Expo</b><BR></TD>
<td valign=top>September 15-18, 2003<BR>Boston, MA<BR>
<a href="http://www.sdexpo.com" target="_blank">
http://www.sdexpo.com</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>PC Expo</b><BR></TD>
<td valign=top>September 16-18, 2003<BR>New York, NY<BR>
<a href="http://www.techxny.com/pcexpo_techxny.cfm" target="_blank">
http://www.techxny.com/pcexpo_techxny.cfm</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>COMDEX Canada</b><BR></TD>
<td valign=top>September 16-18, 2003<BR>Toronto, Ontario<BR>
<a href="http://www.comdex.com/canada/" target="_blank">
http://www.comdex.com/canada/</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>IDUG 2003 - Europe</b><BR></TD>
<td valign=top>October 7-10, 2003<BR>Nice, France<BR>
<a href="http://www.idug.org" target="_blank">
http://www.idug.org</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Linux Clusters Institute Workshops</b><BR></TD>
<td valign=top>October 13-18, 2003<BR>Montpellier, France<BR>
<a href="http://www.linuxclustersinstitute.org/"
target="_blank">
http://www.linuxclustersinstitute.org</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Coast Open Source Software Technology (COSST) Symposium</b><BR></TD>
<td valign=top>October 18, 2003<BR>Newport Beach, CA<BR>
<a href="http://cosst.ieee-occs.org" target="_blank">
http://cosst.ieee-occs.org</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>LISA (17th USENIX Systems Administration Conference)</b><BR></TD>
<td valign=top>October 26-30, 2003<BR>San Diego, CA<BR>
<a href="http://www.usenix.org/events/lisa03/" target="_blank">
http://www.usenix.org/events/lisa03/</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>HiverCon 2003</b><BR></TD>
<td valign=top>November 6-7, 2003<BR>Dublin, Ireland<BR>
<a href="http://www.hivercon.com/" target="_blank">
http://www.hivercon.com/</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>COMDEX Fall</b><BR></TD>
<td valign=top>November 17-21, 2003<BR>Las Vegas, NV<BR>
<a href="http://www.comdex.com/fall2003/" target="_blank">
http://www.comdex.com/fall2003/</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Southern California Linux Expo (SCALE)</b><BR></TD>
<td valign=top>November 22, 2003<BR>Los Angeles, CA<BR>
<a href="http://socallinuxexpo.com/" target="_blank">
http://socallinuxexpo.com/</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Linux Clusters Institute Workshops</b><BR></TD>
<td valign=top>December 8-12, 2003<BR>Albuquerque, NM<BR>
<a href="http://www.linuxclustersinstitute.org/"
target="_blank">
http://www.linuxclustersinstitute.org</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Storage Expo 2003, co-located with Infosecurity 2003</b><BR></TD>
<td valign=top>December 9-11, 2003<BR>New York, NY<BR>
<a href="http://www.infosecurityevent.com/" target="_blank">
http://www.infosecurityevent.com/</A><BR></TD></TR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
</table>
<!-- *** END events table [this line needed by Linux Gazette events.py *** -->
<a name="general"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">News in General</font></H3></center>
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">GNU Server breach
</FONT>
</H3>
<P>
It emerged over the past month that the main file servers of the
<a href="http://www.fsf.org/">GNU project</a> were compromised by a
malicious cracker in mid-march. Although the breach was only noticed in
July, it appears that no source code was tampered with. Nonetheless, it is
important that individuals and organisation who may have downloaded from
the compromised server verify for themselves that the code they received
was intact and untainted. This incident should also bring home to users
the importance of keeping up to date with patches and software updates, and
also the necessity to have established security procedures and backups in
place.
<P>
Original reporting on this story can be found here:
<ul>
<li>
<a href="http://news.zdnet.co.uk/0,39020330,39115701,00.htm">
ZDNet UK: Free Software servers breached</a>
</li>
<li>
<a href="http://www.searchEnterpriseLinux.com/originalContent/0,289142,sid39_gci920359,00.html">
SearchEnterpriseLinux.com: GNU dodges bullet after security breach</a>
</li>
<li>
<a href="http://www.theregister.co.uk/content/55/32355.html">
The Register: GNU servers 'owned' by crackers for months</a>
</li>
</ul>
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Alan Cox Sabbatical
</FONT>
</H3>
<P> Kerneltrap reported that
<a href="http://kerneltrap.org/node/view/759">
Alan Cox is to take a one year sabbatical</a>. He plans to spend his year
studying for an MBA and learning Welsh.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">GNU/Linux Security Certification
</FONT>
</H3>
<P>
Slashdot recently
<a href="http://slashdot.org/article.pl?sid=03/08/05/1217242&mode=nested&tid=106&tid=126&tid=172&tid=185">
highlighted the story</a>
that IBM has
<a href="http://story.news.yahoo.com/news?tmpl=story&cid=569&ncid=738&e=1&u=/nm/20030805/tc_nm/tech_ibm_linux_dc">
succeeded in getting Linux certified</a>
under the Common Criteria
specification. This has implications for government bodies considering Linux
when making purchasing decisions.
The Inquirer reports that this has been a bit of a black-eye for Red Hat,
whose
<a href="http://www.theinquirer.net/?article=11067">
certification effort is stalled, held up indefinitely by the UK-based
testing laboratory Red Hat selected to do the work</a>.
<a name="distro"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Distro News</font></H3></center>
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Ark
</FONT>
</H3>
<P>
Tux Reports have taken a
<a href="http://www.tuxreports.com/article2251.html">
look at Ark Linux</a>.
This RPM based distribution particularly aims to provide a comprehensive
and useful desktop environment.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Debian
</FONT>
</H3>
<P>
<a href="http://www.debian.org/News/weekly/2003/33/">
Debian Weekly News linked</a> to
Jan Ivar Pladsen's document
which describes
<a href="http://www.pvv.org/~pladsen/Indy/HOWTO.html">
how to install Debian GNU/Linux on Indy</a>.
<P>
<hr width="20%" noshade>
<P>
On August 16th, the Debian Project celebrated
<a href="http://www.debian.org/News/2003/20030811">
its 10th birthday</a>.
Linux Planet published a
<a href="http://www.linuxplanet.com/linuxplanet/editorials/4959/1/">
Debian 10-year retrospective</a> to mark the occasion.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Knoppix
</FONT>
</H3>
<P>
Klaus Knopper describes the
<a href="http://www.pctechtalk.com/view.php?id=1239">
Philosophy behind Knoppix</a>.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Libranet
</FONT>
</H3>
<P>
Linuxiran has
<a href="http://www.linuxiran.org/modules/news/article.php?storyid=232">
reviewed Libranet GNU/Linux 2.8</a>.
Evidently they were impressed: "Only one word can describe Libranet's
installer: 'awesome...'" (Courtesy Linux Today).
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Mepis
</FONT>
</H3>
<P>
<a href="http://www.debian.org/News/weekly/2003/33/">
As higlighted by DWN</a>,
<a href="http://www.mepis.org/">
Mepis Linux</a>
is a LiveCD derived from Debian GNU/Linux.
LinuxOnline has some articles on this distribution, including
this LiveCD. The first is
<a href="http://www.pclinuxonline.com/modules.php?name=News&file=article&sid=7115">
an overview</a>,
<a href="http://www.pclinuxonline.com/modules.php?name=News&file=article&sid=7143">
a full review</a>
and an
<a href="http://www.pclinuxonline.com/modules.php?name=News&file=article&sid=7171">
interview with Mepis creator Warren Woodford</a>.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">SuSE
</FONT>
</H3>
<P>
<a href="http://www.sgi.com">
SGI</a>
and
<a href="http://www.suse.de/en">
SuSE Linux</a>
today announced plans to extend the Linux OS to new levels of scalability
and performance by offering a fully supported 64-processor system running a
fully supported, enterprise-grade Linux operating system. Expected to be
available in October, SGI will bundle SuSE Linux Enterprise Server 8 on SGI
Altix 3000 servers and superclusters.
<P>
<hr width="20%" noshade>
<P>
<a href="http://www.siemens.com/sbs">
Siemens Business Servicess</a>
has decided to use SuSE Linux Enterprise Server 8 to underpin its mySAP HR
management system, processing payrolls for more than 170,000 employees
worldwide. The open source operating system and the platform independence
of the SAP R/3 software enable an easy migration to an open, powerful, and
efficient Intel architecture. Linux-based application servers can be
operated independently alongside existing Unix-based servers. Thus, the RM
systems can continue to run until they were amortized and gradually
replaced by Linux servers.
<a name="commercial"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Software and Product News</font></H3></center>
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Biscom Announces Linux FAXCOM Server
</FONT>
</H3>
<P>
<a href="http://www.biscom.com">
Biscom</a>,
a provider of enterprise fax management solutions, has announced the market
release of its Linux FAXCOM Server. The new product integrates the
reliability and efficiency of the Windows FAXCOM Server with the stability
and security of the Linux operating system. Linux FAXCOM Server has been
thoroughly tested is currently available for market release. Linux FAXCOM
Server features support for multiple diverse document attachments via
on-the-fly document conversion, and up to 96 ports on one fax server.
Expanded fax routing destination options for inbound faxes include: fax
port, dialed digits, sender's Transmitting Station Identifier (TSID) and
Caller ID. Furthermore, if appropriate, the same fax may be routed to
multiple destinations, including one or more printers.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">GNU Scientific Library 1.4 released
</FONT>
</H3>
<P>
Version 1.4 of the
<a href="http://www.gnu.org/software/gsl/">
GNU Scientific Library</a>
is now available at:
<blockquote>
<a href="ftp://ftp.gnu.org/gnu/gsl/gsl-1.4.tar.gz">
ftp://ftp.gnu.org/gnu/gsl/gsl-1.4.tar.gz</a>
</blockquote>
and from mirrors worldwide (see
<a href="http://www.gnu.org/order/ftp.html">
http://www.gnu.org/order/ftp.html</a>).
<P>
The GNU Scientific Library (GSL) is a collection of routines for
numerical computing in C. This release is backwards compatible with
previous 1.x releases. GSL now includes support for cumulative
distribution functions (CDFs) contributed by Jason H. Stover. The
full NEWS file entry is appended below.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Mod_python 3.1.0 Alpha
</FONT>
</H3>
<P>
The Apache Software Foundation and The Apache HTTP Server Project
have announced the 3.1.0 ALPHA release of
<a href="http://www.modpython.org/">
mod_python</a>.
<P> Some feature highlights:
<ul>
<li> Server-side sessions with memory or dbm-based storage and session
locking support.
</li>
<li> PSP - a fast flex-based scanner which allows embedding Python code
within HTML.
</li>
<li> Native cookie support, including support for automatic cryptographic
cookie signing and marshalling.
</li>
<li> Compatibility with Python 2.3, as well as many other enhancements.
</li>
<li> Alpha releases are NOT considered stable and do contain bugs. Some
functionality may change before the first beta release.
</li>
</ul>
<p>
Mod_python 3.1.0a is available for download from:
<a href="http://httpd.apache.org/modules/python-download.cgi">
http://httpd.apache.org/modules/python-download.cgi</a>
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Samba
</FONT>
</H3>
<P>
Linux Today has
<a href="http://linuxtoday.com/infrastructure/2003082901426NWSVSW">
carried the news</a>
that Samba-3.0.0 RC2 is now available for download
<!-- =================================================================== -->
<!-- *** BEGIN bio *** -->
<!-- *** END bio *** -->
<!-- *** BEGIN author bio *** -->
<P>
<P>
<P> Mick is LG's News Bytes Editor.
<!-- *** BEGIN bio *** -->
<P>
<IMG ALIGN="LEFT" VALIGN="top" ALT="[Picture]" SRC="../gx/2002/tagbio/conry.jpg"
WIDTH="128" HEIGHT="158">
<em>Born some time ago in Ireland, Michael is currently working on
a PhD thesis in the Department of Mechanical Engineering, University
College Dublin. The topic of this work is the use of Lamb waves in
nondestructive testing. GNU/Linux has been very useful in this work, and
Michael has a strong interest in applying free software solutions to
other problems in engineering. When his thesis is completed, Michael
plans to take a long walk.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2003, Michael Conry.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 94 of <i>Linux Gazette</i>, September 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Ecol</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/malonda.html">Javier Malonda</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
The Ecol comic strip is written for <A
HREF="http://escomposlinux.org">escomposlinux.org</A> (ECOL), the web site tha
t supports, es.comp.os.linux, the Spanish USENET newsgroup for Linux. The
strips are drawn in Spanish and then translated to English by the author.
<P>
<EM>These images are scaled down to minimize horizontal scrolling.
To see a panel in all its clarity, click on it.</EM>
<P>
<A HREF="misc/ecol/ecol-122-e-as.png">
<IMG ALT="[cartoon]" SRC="misc/ecol/ecol-122-e-as.png"
WIDTH="640" HEIGHT="240"></A>
<BR CLEAR="all">
<A HREF="misc/ecol/ecol-123-e-as.png">
<IMG ALT="[cartoon]" SRC="misc/ecol/ecol-123-e-as.png"
WIDTH="640" HEIGHT="240"></A>
<BR CLEAR="all">
<A HREF="misc/ecol/ecol-124-e-as.png">
<IMG ALT="[cartoon]" SRC="misc/ecol/ecol-124-e-as.png"
WIDTH="640" HEIGHT="240"></A>
<BR CLEAR="all">
<P>
All Ecol cartoons are at
<A HREF="http://tira.escomposlinux.org/">tira.escomposlinux.org</A> (Spanish),
<A HREF="http://comic.escomposlinux.org/">comic.escomposlinux.org</A> (English)
and
<A HREF="http://tira.puntbarra.com/">http://tira.puntbarra.com/</A> (Catalan).
The Catalan version is translated by the people who run the site; only a few
episodes are currently available.
<P> <SMALL>These cartoons are copyright Javier Malonda. They may be copied,
linked or distributed by any means. However, you may not distribute
modifications. If you link to a cartoon, please <A
HREF="mailto:jmr@escomposlinux.org">notify</A> Javier, who would appreciate
hearing from you.
</SMALL>
<!-- *** BEGIN author bio *** -->
<P>
<P>
<!-- *** BEGIN bio *** -->
<!-- P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
</em>
<br CLEAR="all" -->
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2003, Javier Malonda.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 94 of <i>Linux Gazette</i>, September 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">From C To Assembly Language</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/ramankutty.html">Hiran Ramankutty</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<html>
<body>
<h2><b>1. Overview</b></h2>
<p>
What is a microcomputer system made up of? A microcomputer system is
made up of a <i>microprocessor unit</i> (MPU), a bus system, a memory
subsystem, an I/O subsystem and an interface among all components. A
typical answer one can expect.
</p>
<p>
This is only the hardware side. Every microcomputer system requires a
software so as to direct each of the hardware components while they
are performing their respective tasks. Computer software can be
thought about at system side (system software) and user side (user
software).
</p>
<p>
The user software may include some in-built libraries and user created
libraries in the form of subroutines which may be needed in preparing
programs for execution.
</p>
<p>
The system software may encompass a variety of high-level language
translators, an assembler, a text editor, and several other programs
for aiding in the preparation of other programs. We already know that
there are three levels of programming and they are Machine language,
Assembly language and High-level language.
</p>
<p>
Machine language programs are programs that the computer can
understand and execute directly (think of programming in any
microprocessor kit). Assembler language instructions match machine
language instructions on a more or less one-for-one basis, but are
written using character strings so that they are more easily
understood, and high-level language instructions are much closer to
the English language and are structured so that they naturally
correspond to the way programmers think. Ultimately, an assembler
language or high-level language program must be converted into machine
language by programs called translators. They are referred to as
<i>assembler</i> and <i>compiler</i> or <i>interpreter</i> respectively.
</p>
<p>
Compilers for high-level languages like C/C++ have the ability to
translate high-level language into assembly code. The GNU C and C++
Compiler option of -S will generate an assembly code equivalent to
that of the corresponding source program. Knowing how the most
rudimentary constructs like loops, function calls and variable
declaration are mapped into assembly language is one way to achieve
the goal of mastering C internals. Before proceeding further, you must
make it a point that you are familiar with Computer Architecture and
Intel x86 assembly language to help you follow the material presented
here.
</p>
<h2><b>2. Getting Started</b></h2>
<p>
To begin with, write a small program in C to print <i>hello world</i>
and compile it with -S options. The output is an assembler code for
the input file specified. By default, GCC makes the assembler file
name by replacing the suffix `.c', with `.s'. Try to interpret the few
lines at the end of the assembler file.
</p>
<p>
The 80386 and above family of processors have myriads of registers,
instructions and addressing modes. A basic knowledge about only a few
simple instructions is sufficient to understand the code generated by
the GNU compiler.
</p>
<p>
Generally, any assembly language instruction includes a <i>label</i>, a
<i>mnemonic</i>, and <i>operands</i>. An operand's notation is
sufficient to decipher the operand's addressing mode. The
<i>mnemonics</i> operate on the information contained in the operands.
In fact, assembly language instructions operate on registers and
memory locations. The 80386 family has general purpose registers (32
bit) called <i>eax</i>, <i>ebx</i>, <i>ecx</i> etc. Two registers,
<i>ebp</i> and <i>esp</i> are used for manipulating the stack. A
typical instruction, written in GNU Assembler (GAS) syntax, would look
like this:
</p>
<p></p>
<pre>
movl $10, %eax
</pre>
<p>
This instruction stores the value 10 in the <i>eax</i> register. The
prefix `%' to the register name and `$' to the immediate value are
essential assembler syntax. It is to be noted that not all assemblers
follow the same syntax.
</p>
<p>
Our first assembly language program, stored in a file named
<i>first.s</i> is shown in <b>Listing 1</b>.
</p>
<p></p>
<pre>
<i>#Listing 1</i>
.globl main
main:
movl $20, %eax
ret
</pre>
<p>
This file can be assembled and linked to generate an <i>a.out</i> by
giving the command <i>cc first.s</i>. The extensions `.s' are
identified by the GNU compiler front end <i>cc</i> as assembly
language files and invokes the assembler and linker, skipping the
compilation phase.
</p>
<p>
The first line of the program is a comment. The <i>.globl</i>
assembler directive serves to make the symbol <i>main</i> visible to
the linker. This is vital as your program will be linked with the C
startup library which will contain a call to <i>main</i>. The linker
will complain about 'undefined reference to symbol main' if that line
is omitted (try it). The program simply stores the value 20 in register
<i>eax</i> and returns to the caller.
</p>
<h2><b>3. Arithmetic, Comparison, Looping</b></h2>
<p>
Our next program is <b>Listing 2</b> which computes the factorial of a
number stored in <i>eax</i>. The factorial is stored in <i>ebx</i>.
</p>
<p></p>
<pre>
<i>#Listing 2</i>
.globl main
main:
movl $5, %eax
movl $1, %ebx
L1: cmpl $0, %eax //compare 0 with value in <i>eax</i>
je L2 //jump to L2 if 0==eax (je - jump if equal)
imull %eax, %ebx // ebx = ebx*eax
decl %eax //decrement eax
jmp L1 // unconditional jump to L1
L2: ret
</pre>
<p>
<i>L1</i> and <i>L2</i> are labels. When control flow reaches
<i>L2</i>, <i>ebx</i> would contain the factorial of the number stored
in <i>eax</i>.
</p>
<h2><b>4. Subroutines</b></h2>
<p>
When implementing complicated programs, we split the tasks to be
solved in systematic order. We write subroutines and functions for
each of the tasks which are called when ever required. <b>Listing 3</b>
illustrates subroutine call and return in assembly language programs.
</p>
<p></p>
<pre>
<i>#Listing 3</i>
.globl main
main:
movl $10, %eax
call foo
ret
foo:
addl $5, %eax
ret
</pre>
<p>
The instruction <i>call</i> transfers control to subroutine <i>foo</i>.
The <i>ret</i> instruction in <i>foo</i> transfers control back to the
instruction after the call in <i>main</i>.
</p>
<p>
Generally, each function defines the scope of variables it uses in
each call of the routine. To maintain the scopes of variables you need
space. The stack can be used to maintain values of the variables in
each call of the routine. It is important to know the basics of how
the activation records can be maintained for repeated, recursive calls
or any other possible calls in the execution of the program. Knowing
how to manipulate registers like <i>esp</i> and <i>ebp</i> and making
use of instructions like <i>push</i> and <i>pop</i> which operate on
the stack are central to understanding the subroutine call and return
mechanism.
</p>
<h2><b>5. Using The Stack</b></h2>
<p>
A section of your program's memory is reserved for use as a stack. The
Intel 80386 and above microprocessors contain a register called stack
pointer, <i>esp</i>, which stores the address of the top of stack.
<b>Figure 1</b> below shows three integer values, 49,30 and 72, stored
on the stack (each integer occupying four bytes) with <i>esp</i>
register holding the address of the top of stack.
</p>
<a href="stack1.bmp">Figure 1</a>
<p>
Unlike the stack analogous to a pile of bricks growing up wards, on
Intel machines stack grows down wards. <b>Figure 2</b> shows the stack
layout after the execution of the instruction <i>pushl $15</i>.
</p>
<a href="stack2.bmp">Figure 2</a>
<p>
The stack pointer register is decremented by four and the number 15 is
stored as four bytes at locations 1988, 1989, 1990 and 1991.
</p>
<p>
The instruction <i>popl %eax</i> copies the value at top of stack (four
bytes) to the <i>eax</i> register and increments <i>esp</i> by four.
What if you do not want to copy the value at top of stack to any
register? You just execute the instruction <i>addl $4, %esp</i> which
simply increments the stack pointer.
</p>
<p>
In <b>Listing 3</b>, the instruction <i>call foo</i> pushes the
address of the instruction after the call in the calling program on to
the stack and branches to <i>foo</i>. The subroutine ends with
<i>ret</i> which transfers control to the instruction whose address is
taken from the top of stack. Obviously, the top of stack must contain
a valid return address.
</p>
<h2><b>6. Allocating Space for Local Variables</b></h2>
<p>
It is possible to have a C program manipulating hundreds and thousands
of variables. The assembly code for the corresponding C program will
give you an idea of how the variables are accommodated and how the
registers are used for manipulating the variables without causing any
conflicts in the final result that is to be obtained.
</p>
<p>
The registers are few in number and cannot be used for holding all the
variables in a program. Local variables are allotted space within the
stack. <b>Listing 4</b> shows how it is done.
</p>
<p></p>
<pre>
<i>#Listing 4</i>
.globl main
main:
call foo
ret
foo:
pushl %ebp
movl %esp, %ebp
subl $4, %esp
movl $10, -4(%ebp)
movl %ebp, %esp
popl %ebp
ret
</pre>
<p>
First, the value of the stack pointer is copied to <i>ebp</i>, the base
pointer register. The base pointer is used as a fixed reference to
access other locations on the stack. In the program, <i>ebp</i> may be
used by the caller of <i>foo</i> also, and hence its value is copied
to the stack before it is overwritten with the value of <i>esp</i>.
The instruction <i>subl $4, %esp</i> creates enough space (four bytes)
to hold an integer by decrementing the stack pointer. In the next line,
the value 10 is copied to the four bytes whose address is obtained by
subtracting four from the contents of <i>ebp</i>. The instruction
<i>movl %ebp, %esp</i> restores the stack pointer to the value it had
after executing the first line of <i>foo</i> and <i>popl %ebp</i>
restores the base pointer register. The stack pointer now has the same
value which it had before executing the first line of <i>foo</i>. The
table below displays the contents of registers <i>ebp</i>, <i>esp</i>
and stack locations from 3988 to 3999 at the point of entry into
<i>main</i> and after the execution of every instruction in
<b>Listing 4</b> (except the return from main). We assume that
<i>ebp</i> and <i>esp</i> have values 7000 and 4000 stored in them and
stack locations 3988 to 3999 contain some arbitrary values 219986,
1265789 and 86 before the first instruction in <i>main</i> is executed.
It is also assumed that the address of the instruction after
<i>call foo</i> in <i>main</i> is 30000.
</p>
<p></p>
<a href="table.bmp">Table 1</a>
<h2><b>6. Parameter Passing and Value Return</b></h2>
<p>
The stack can be used for passing parameters to functions. We will
follow a convention (which is used by our C compiler) that the value
stored by a function in the <i>eax</i> register is taken to be the
return value of the function. The calling program passes a parameter to
the callee by pushing its value on the stack. <b>Listing 5</b>
demonstrates this with a simple function called <i>sqr</i>.
</p>
<p></p>
<pre>
<i>#Listing 5</i>
.globl main
main:
movl $12, %ebx
pushl %ebx
call sqr
addl $4, %esp //adjust esp to its value before the push
ret
sqr:
movl 4(%esp), %eax
imull %eax, %eax //compute eax * eax, store result in eax
ret
</pre>
<p>
Read the first line of <i>sqr</i> carefully. The calling function
pushes the content of <i>ebx</i> on the stack and then executes a
<i>call </i> instruction. The call will push the return address on the
stack. So inside <i>sqr</i>, the parameter is accessible at an offset
of four bytes from the top of stack.
</p>
<h2><b>8. Mixing C and Assembler</b></h2>
<p>
<b>Listing 6</b> shows a C program and an assembly language function.
The C function is defined in a file called <i>main.c</i> and the
assembly language function in <i>sqr.s</i>. You compile and link the
files together by typing <i>cc main.c sqr.s</i>.
</p>
<p>
The reverse is also pretty simple. <b>Listing 7</b> demonstrates a C
function print and its assembly language caller.
</p>
<p></p>
<pre>
<i>#Listing 6</i>
//main.c
main()
{
int i = sqr(11);
printf("%d\n",i);
}
//sqr.s
.globl sqr
sqr:
movl 4(%esp), %eax
imull %eax, %eax
ret
</pre>
<p></p>
<pre>
<i>#Listing 7</i>
//print.c
print(int i)
{
printf("%d\n",i);
}
//main.s
.globl main
main:
movl $123, %eax
pushl %eax
call print
addl $4, %esp
ret
</pre>
<h2><b>9. Assembler Output Generated by GNU C</b></h2>
<p>
I guess this much reading is sufficient for understanding the
assembler output produced by <i>gcc</i>. <b>Listing 8</b> shows the
file <i>add.s</i> generated by <i>gcc -S add.c</i>. Note that
<i>add.s</i> has been edited to remove many assembler directives
(mostly for alignments and other things of that sort).
</p>
<p></p>
<pre>
<i>#Listing 8</i>
//add.c
int add(int i,int j)
{
int p = i + j;
return p;
}
//add.s
.globl add
add:
pushl %ebp
movl %esp, %ebp
subl $4, %esp //create space for integer p
movl 8(%ebp),%edx //8(%ebp) refers to i
addl 12(%ebp), %edx //12(%ebp) refers to j
movl %edx, -4(%ebp) //-4(%ebp) refers to p
movl -4(%ebp), %eax //store return value in eax
leave //i.e. to movl %ebp, %esp; popl %ebp ret
</pre>
<p>
The program will make sense upon realizing the C statement
<b>add(10,20)</b> which gets translated into the following assembler
code:
</p>
<p></p>
<pre>
pushl $20
pushl $10
call add
</pre>
<p>
Note that the second parameter is passed first.
</p>
<h2><b>10. Global Variables</b></h2>
<p>
Space is created for local variables on the stack by decrementing the
stack pointer and the allotted space is reclaimed by simply
incrementing the stack pointer. So what is the equivalent GNU C
generated code for global variables? <b>Listing 9</b> provides the
answer.
</p>
<p></p>
<pre>
<i>#Listing 9</i>
//glob.c
int foo = 10;
main()
{
int p foo;
}
//glob.s
.globl foo
foo:
.long 10
.globl main
main:
pushl %ebp
movl %esp,%ebp
subl $4,%esp
movl foo,%eax
movl %eax,-4(%ebp)
leave
ret
</pre>
<p>
The statement <i>foo: .long 10</i> defines a block of 4 bytes named
foo and initializes the block with zero. The <i>.globl foo</i>
directive makes foo accessible from other files. Now try this out.
Change the statement <b>int foo</b> to <b>static int foo</b>. See how
it is represented in the assembly code. You will notice that the
assembler directive <i>.globl</i> is missing. Try this out for
different storage classes (double, long, short, const etc.).
<h2><b>11. System Calls</b></h2>
<p>
Unless a program is just implementing some math algorithms in
assembly, it will deal with such things as getting input, producing
output, and exiting. For this it will need to call on OS services. In
fact, programming in assembly language is quite the same in different
OSes, unless OS services are touched.
</p>
<p>
There are two common ways of performing a system call in Linux:
through the C library (libc) wrapper, or directly.
</p>
<p>
Libc wrappers are made to protect programs from possible system call
convention changes, and to provide POSIX compatible interface if the
kernel lacks it for some call. However, the UNIX kernel is usually
more-or-less POSIX compliant: this means that the syntax of most libc
"system calls" exactly matches the syntax of real kernel system calls
(and vice versa). But the main drawback of throwing libc away is that
one loses several functions that are not just syscall wrappers, like
printf(), malloc() and similar.
</p>
<p>
System calls in Linux are done through int 0x80. Linux differs from
the usual Unix calling convention, and features a "fastcall"
convention for system calls. The system function number is passed in
eax, and arguments are passed through registers, not the stack. There
can be up to six arguments in ebx, ecx, edx, esi, edi, ebp
consequently. If there are more arguments, they are simply passed
though the structure as first argument. The result is returned in eax,
and the stack is not touched at all.
</p>
<p>Consider Listing 10 given below.</p>
<p></p>
<pre>
<i>#Listing 10
#fork.c</i>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
int main()
{
fork();
printf("Hello\n");
return 0;
}
</pre>
<p>
Compile this program with the command <i>cc -g fork.c -static</i>. Use
the <i>gdb</i> tool and type the command <i>disassemble fork</i>.
You can see the assembly code used for fork in the program. The
<i>-static</i> is the static linker option of GCC (see man page). You
can test this for other system calls and see how the actual functions
work.
</p>
<p>
There have been several attempts to write an up-to-date documentation
of the Linux system calls and I am not making this another of them.
</p>
<h2><b>11. Inline Assembly Programming</b></h2>
<p>
The GNU C supports the x86 architecture quite well, and includes the
ability to insert assembly code within C programs, such that register
allocation can be either specified or left to GCC. Of course, the
assembly instruction are architecture dependent.
</p>
<p>
The <i>asm</i> instruction allows you to insert assembly instructions
into your C or C++ programs. For example the instruction:
</p>
<p></p>
<pre>
asm ("fsin" : "=t" (answer) : "0" (angle));
</pre>
<p>
is an x86-specific way of coding this C statement:
</p>
<p></p>
<pre>
answer = sin(angle);
</pre>
<p>
You can notice that unlike ordinary assembly code instructions
<i>asm</i> statements permit you to specify input and output operands
using C syntax. <i>Asm</i> statements should not be used
indiscriminately. So, when should we use them?
</p>
<p></p>
<ul>
<li> <i>Asm</i> statements allow your programs to access the computer
hardware directly. This can produce programs that execute quickly. You
can use them when writing operating system code that directly needs to
interact with the hardware. For example, <i>/usr/include/asm/io.h</i>
contains assembly instructions to access input/output ports directly.
<li> Inline assembly instructions also speed up the innermost loops
of the programs. For instance, <i>sine</i> and <i>cosine</i> of the
same angles can be found by <i>fsincos</i> x86 instruction. Probably,
the two listings given below will help you understand this factor
better.
</ul>
<pre>
<i>#Listing 11
#Name : bit-pos-loop.c
#Description : Find bit position using a loop</i>
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char *argv[])
{
long max = atoi (argv[1]);
long number;
long i;
unsigned position;
volatile unsigned result;
for (number = 1; number <= max; ; ++number) {
for (i=(number>>1), position=0; i!=0; ++position)
i >>= 1;
result = position;
}
return 0;
}
</pre>
<p></p>
<pre>
<i>#Listing 12
#Name : bit-pos-asm.c
#Description : Find bit position using bsrl</i>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
long max = atoi(argv[1]);
long number;
unsigned position;
volatile unsigned result;
for (number = 1; number <= max; ; ++number) {
asm("bsrl %1, %0" : "=r" (position) : "r" (number));
result = position;
}
return 0;
}
</pre>
<p>
Compile the two versions with full optimizations as given below:
</p>
<p></p>
<pre>
$ cc -O2 -o bit-pos-loop bit-pos-loop.c
$ cc -O2 -o bit-pos-asm bit-pos-asm.c
</pre>
<p>
Measure the running time for each version by using the time command
and specifying a large value as the command-line argument to make sure
that each version takes at least few seconds to run.
</p>
<p></p>
<pre>
$ time ./bit-pos-loop 250000000
</pre>
<p>and</p>
<p></p>
<pre>
$ time ./bit-pos-asm 250000000
</pre>
<p>
The results will be varying in different machines. However, you will
notice that the version that uses the inline assembly executes a great
deal faster.
</p>
<p>
GCC's optimizer attempts to rearrange and rewrite program' code to
minimize execution time even in the presence of <i>asm</i> expressions.
If the optimizer determines that an <i>asm's</i> output values are
not used, the instruction will be omitted unless the keyword
<i>volatile</i> occurs between <i>asm</i> and its arguments. (As a
special case, GCC will not move an <i>asm</i> without any output
operands outside a loop.) Any <i>asm</i> can be moved in ways that are
difficult to predict, even across jumps. The only way to guarantee a
particular assembly instruction ordering is to include all the
instructions in the same <i>asm</i>.
</p>
<p>
Using <i>asm's</i> can restrict the optimizer's effectiveness because
the compiler does not know the <i>asms'</i> semantics. GCC is forced
to make conservative guesses that may prevent some optimizations.
</p>
<h2><b>12. Exercises</b></h2>
<ol>
<li>Interpret the assembly code for C program in Listing 6. Modify it
for eliminating errors that are obtained when generating assembly code
with -Wall option. Compare the two assembly codes. What changes do you
observe?
<li>Compile several small C programs with and without optimization
options (like -O2). Read the resulting assembly codes and find out
some common optimization tricks used by the compiler.
<li>Interpret assembly code for switch statement.
<li>Compile several small C programs with inline asm statements. What
differences do you observe in assembly codes for such programs.
<li>A nested function is defined inside another function (the
"enclosing function"), such that:
<ul>
<li> the nested function has access to the enclosing function's
variables; and
<li> the nested function is local to the enclosing function, that is,
it can be called from elsewhere unless the enclosing function gives
you a pointer to the nested function.
</ul>
<p></p>
<p>
Nested functions can be useful because they help control the
visibility of a function.
</p>
<p>
Consider <b>Listing 13</b> given below:
</p>
<p></p>
<pre>
<p>
<i>#Listing 13</i>
/* myprint.c */
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i;
void my_print(int k)
{
printf("%d\n",k);
}
scanf("%d",&i);
my_print(i);
return 0;
}
</p></pre>
<p>
Compile this program with <i>cc -S myprint.c</i> and interpret the
assembly code. Also try compiling the program with the command
<i>cc -pedantic myprint.c</i>. What do you observe?
</p>
</ol>
</body>
</html>
<!-- *** BEGIN author bio *** -->
<P>
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
I have just given my final year B.Tech examinations in Computer Science and
Engineering and a native of Kerala, India.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2003, Hiran Ramankutty.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 94 of <i>Linux Gazette</i>, September 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Play Encoded DVDs in Xine</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/kolp.html">LeaAnne Kolp</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<h2>Play Encoded DVDs in Xine</h2>
<p>First of all, you'll need to download the plugins.</p>
<p>xine_d4d_plugin-0.3.2.tar.gz</p>
<p>xine-d5d-0.2.7.tgz</p>
<p>xine-lib-0.9.12.tar</p>
<p>xine-ui-0.9.12.tar</p>
<p>These plugins will ONLY work with the xine-lib and xine-ui-0.9.12.
If you get 0.9.13 it will NOT work.</p>
<p>After you download those, switch to root</p>
<p><PRE>[tux@linux tux]$ su</PRE></p>
<p><PRE>Password: *****</PRE></p>
<p>Then you'll have to move the files that you just downloaded to your
/root/ directory. Do this by typing in the <br>
following at the command promt.</p>
<p><PRE>mv *.tar.gz /root/</PRE></p>
<p>If that doesn't work, then just type out the following:</p>
<p><PRE>mv xine-lib-0.9.12.tar.gz /root/</PRE></p>
<p>Do this for each of the files. After you get that done, then switch
to your /root/ directory by typing in the following:</p>
<p><PRE>cd /root/ type: ls</PRE></p>
<p>And you'll get a listing of all the files in your /root/ directory.
Now for the good part :)</p>
<p>Now to gunzip and untar it :)</p>
<p>To do this, type in the following:</p>
<p><PRE>gunzip -d xine-lib-0.9.12.tar.gz</PRE></p>
<p>Switch to that directory by typing the following:</p>
<p><PRE>cd xine-lib-0.9.12</PRE></p>
<p>Now type in: <PRE>ls</PRE></p>
<p>Now that you're in the directory, you'll have a README file and
INSTALL file. ALWAYS read the README file. <br>
No matter how many times you've done this before, something might have
changed. If the README doesn't tell <br>
you anything read the INSTALL file.</p>
<p>To do this, type in:</p>
<p><PRE>more README </PRE>(just like it is in the directory, if you don't type it
identical, it won'taccess it)</p>
<p><PRE>more INSTALL</PRE></p>
<p>Normally, a typical installation is done by typing in these
commands:</p>
<p><PRE>./configure
make
make check
make install</PRE></p>
<p>Again, always read the README. Each distribution of Linux is
different and therefore the installation <br>
instructions could be different.</p>
<p>Keep repeating the above steps until all 4 files are installed.</p>
<p>Then type in:</p>
<p><PRE>tar -xvf xine-lib.0.9.12.tar</PRE></p>
<p>Now type in: <PRE>ls</PRE></p>
<p>You'll see a directory (in dark blue) with the name:</p>
<p><PRE>xine-lib-0.9.12</PRE></p>
<p>Then type in the following to update your drive:</p>
<p><PRE>updatedb</PRE></p>
<p>That could take awhile depending on your drive. When that's done,
you'll have to locate xine.</p>
<p>To do so, type in the following:</p>
<p><PRE>locate xine</PRE></p>
<p>It usually puts it in /usr/local/bin/ but to be on the safe side,
locate it. :)</p>
<p>Once you have it located, until you add it to your menus, type in
the directoryof where it was. <br>
So if it was in /usr/local/bin/xine you would type in:
/usr/local/bin/xine</p>
<p>That would start the program running if that's where it was located.</p>
<p>Now here's the tricky part that you'll have to play with and figure
out on your own. When xine comes up, you'll <br>
see the d4d and d5d buttons at the bottom. When you put a dvd into the
dvdrom drive you'll have to click on either the <br>
d4d or d5d button to get it to play the encoded dvd.</p>
<p>Unfortunately, I don't know which one will work with the dvd you put
in.</p>
<p>Some dvds take the d5d, others take the d4d, you'll just have to
play around with it and experiment to find the one that's right. <br>
What I've started doing is when I put a dvd in and find out which
plugin works (i.e. d4d, d5d) I write it down, so I know and <br>
I don't have to play games with it to figure it out! :)</p>
<p>Congratulations! You've just gotten the plugins to work and now you
can sit back and enjoy the movie!</p>
<!-- *** BEGIN author bio *** -->
<P>
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
Hi, my name is LeaAnne and I've been Windows Free since March
2003.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2003, LeaAnne Kolp.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 94 of <i>Linux Gazette</i>, September 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Under /etc (A Simple Guide)</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/lalji.html">AmirAli Lalji</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<H2>Abstract:</H2>
<P>This article is focused towards Linux newbies providing them with a basic
understanding of /etc sub-directory.</P>
<H2>Introduction</H2>
<P>Newcomers to Linux, especially those coming from the Windows background,
often find files in the /etc directory difficult to understand. In this
article I will give a brief explanation of some of these files and their use.
But, before we dive into the /etc directory I would like to point out that
changes to some of these files can render your system unstable or in some
circumstances unbootable. I cannot emphasize this enough that you should make a
backup of the file(s) before making any changes. </P>
<H2>Lets Dive In....</H2>
<b>/etc/exports</b>
<P>This file contains the partition configuration to load NFS (Network File Systems).
It tells how partitions are mounted and shared with other Linux/UNIX systems.</P>
<b>/etc/ftpusers</b>
<P>This file contains login names of users who are not allowed to login via FTP.
It is recommended to add user root in this file for security.</P>
<b>/etc/fstab</b>
<P>This file automatically mounts filesystems which are spread accross multiple
drives or seperate partitions. This file is checked when the system boots and
filesystems mounted.</P>
<b>/etc/hosts.[allow, deny]</b>
<P>You can control access to your network by using these files. You can add hosts
to hosts.allow file to which you want to grant access to your network or add
hosts to hosts.deny to which you dont.</P>
<b>/etc/inetd.conf or /etc/xinetd.conf</b>
<P>The inetd file can be called the father of networking services. This file is
responsible for starting services like FTP, TELNET etc. Some Linux distributions
come with xinetd.conf which stands for Extended Internet Services Daemon, which
provides all the functionnalities and capabilities of inetd but extends them
further.</P>
<P>It is advisable to comment services which you do not use.</P>
<b>/etc/inittab</b>
<P>This file describes what takes place or which processes are started at bootup or
at different runlevels. Runlevel is defined as a state in which the Linux box is
currently in. Linux has 7 runlevels from 0-6.</P>
<b>/etc/motd</b>
<P>This file which stands for "message of the day" is executed and its contents
displayed after a successful login.</P>
<b>/etc/passwd</b>
<P>This file contains user information. Whenever a new user is added, an entry is
added to this file containing the loginname, password etc. This file is readable
by everyone on the system. If the password field contains "x" than encrypted
passwords are stored in /etc/shadow file which is only accessible by user root.</P>
<b>/etc/profile</b>
<P>When a user logs in a number of configuration files are executed, including
/etc/profile. This file contains settings and global startup information for
bash shell.</P>
<b>/etc/services</b>
<P>This file works in conjunction with /etc/inetd.conf or /etc/xinetd.conf files
(see above). This file determines which port a service mentioned in inetd.conf
is to use, for eg. FTP/21, TELNET/23 etc.</P>
<b>/etc/securetty</b>
<P>This file lists ttys from which root is allowed to login. For security reasons
it is recommended to keep just tty1 for root login.</P>
<b>/etc/shells</b>
<P>This file contains names of all shells installed in the system with their full
path names.</P>
<H2>In the end....</H2>
<P>I hope you enjoyed this article and hope it helped in understanding the /etc
directory. You might find other subdirectories beneath the /etc directory which
are application specific for eg. /etc/httpd, /etc/sendmail are
for apache and sendmail respectively.</P>
<P>If you have any comments or suggestions, please feel free to email me at
aalalji@bcs.org.uk</P>
<!-- *** BEGIN author bio *** -->
<P>
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
AmirAli Lalji is a System Administrator/DBA and lives and works in UK
and Portugal.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2003, AmirAli Lalji.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 94 of <i>Linux Gazette</i>, September 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Linux based Radio Timeshifting</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/yan-fa.html">Yan-Fa Li</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<h2>1.0 Introduction</h2>
Like a lot of gadget freaks I have a Tivo in the living room. Now while
one could argue that thanks to an infestation of Clear Channel there
really isn't much of interest to listen to anymore, there is still
public radio. I listen to a lot of NPR while driving in the car, and I
often find I miss programs I find interesting, or worse, I arrive at my
destination and have to stop listening. So naturally I'd been thinking
for some months now, why not invest some time and effort and look at
how to build a PRR (Personal Radio Recorder).
<p>
Obviously I'm not the only one. There are now some commercial
offerings like <a href="http://radioyourway.com/">this</a>,
and quite a few people appear to have done <a
href="http://gary.burd.info/content/articles/fmcapture.html">projects</a>
to timeshift radio. There's even a <a
href="http://osl.iu.edu/~tveldhui/radio/">how-to</a>,
and slashdot had a big thread about it <a
href="http://ask.slashdot.org/askslashdot/03/01/10/1053222.shtml?tid=137">recently</a>.
<p>
These notes are all based on using RedHat Linux 7.3, so your mileage may
vary if using something like SuSe or Mandrake. I believe they already
come with Alsa, for example, so you can skip those parts that involve
installing them if your system already comes pre-installed with it.
<p>
<h3>The Basics</h3>
Pretty much all the projects I've seen out there have the same things
in common. They use one of three kinds of setup:
<p>
<ul>
<li>A regular analog radio tuned to a single station connected
to the line-in of your PC. Pros: really cheap and easy.
Cons: single station only.
<li>A programmable tuner card with radio function and built
in audio device. Pros: self contained solution, no sound
card required. Cons: PCs are quite noisy electrically;
perhaps a lack of Linux drivers.
<li>An external programmable Radio and the line-in, like the popular
but discontinued DSB-R100 radio from D-link. Pros: programmable
by the PC; replaceable antenna; outside of the computer. Cons:
possible lack of drivers and potentially more expensive than the
other two options.
</ul>
Naturally I picked the USB radio, since I wanted the flexibility of being
able to replace the radio easily, and knew that drivers already existed
in the Linux kernel for this device under the Video For Linux APIs.
<p>
<h2>3. Architecture</h2>
I had a few requirements:
<ol>
<li> Output straight to mp3, and avoid creating any intermediate
wave files. Two hours of Prairie Home Companion, for example,
would be 1.2GB as 44KHz wave files, so this is definitely
something to be avoided.
<li> Decent ID3 tags so the files had some useful info contained
within them rather than just in the filename.
<li> An automated system of reaping the files at regular intervals
to avoid eating up huge amounts of disk. NPR is highly
topical and current and generally not something I want to
archive long term.
</ol>
<p>
The basic capture system ended up looking like this:
<pre>
Alsa HW Interface -> [ ecasound ] -> < Wav Stream > -> [ lame encoder ] -> < mp3 >
</pre>
Nice and simple. It just requires a little syntactic sugar to hold
it all together. Since I wanted to encode VBR mp3s on the fly I had a
few worries about CPU usage. I also planned installing it on my main
file server since it's always on and therefore an ideal candidate.
Using an 850MHz celeron, my tests showed the load to be about 40-50%
while capturing and encoding. This still left plenty of CPU for other
tasks like serving files, ssh and http.
<p>
Your mileage will of course vary if you're running X for example, which
notoriously causes skipping with sound cards. However, since my system
is a dedicated file server I've long stopped running a GUI on it. It
never became an issue, but keep it in mind for your target system. <p>
<h3>Encoding FM in real-time as MP3</h3>
A little googling got me a wealth of excellent information about FM
mp3 encoding. Firstly, FM has a hard cut off for all frequencies above
15KHz at the transmitter, so any information above that can be safely
ignored while encoding; secondly, the optimal bitrates for FM appear
to be somewhere between 96 and 112kbits, since it's mostly voice with
only a modicum of music and we're already saving 5KHz in the frequency
range anyway. We therefore have more than enough bits remaining to get
a faithful encoding. Thirdly, since I was planning on using Lame encoder,
joint stereo was a must. Not only is the joint stereo mode of Lame
excellent, but it also leaves more bits for the encoding.
<h3>Hardware Constraints</h3>
At a bare minimum, I wouldn't recommend anything slower than a 450MHz
Pentium III for this task, though if you are willing to switch to Average
Bit Rate and a slightly lower encoding rate from the one I've used, you
could possibly get away with a well tuned 350MHz PII. Having a disk
on the system itself is also optional, as it only needs to keep up with
~112kbps of data plus network overhead, so one could create a completely
diskless system that booted off the network or a flash card which dumped
all its recordings back to the network.
<p>
Check out <a href="http://compgeeks.com">compgeeks</a> or <a
href="http://computersurplusoutlet.com">CSO</a> for low end systems
which would be suitable for this duty.
<p>
<h2>4.0 Recording Audio Under Linux</h2>
This is actually a bigger challenge than it seems. While a large number
of audio cards are supported by Linux for playback, not very many are all
that great for recording. A great source of information can be found
at the Alsa Project <a href="http://www.alsa-project.org/alsa-doc/">web
site</a>. Having already used Alsa on a number of systems and projects
previously, I decided to use it for the PRR project. And don't forget,
it's the future of Linux audio, as it's already in the 2.6 kernels.
<p>
The next problem is figuring out what to use to do
the actual recording. After looking at a variety of
solutions such as sox and alsarecord, I settled on using <a
href="http://www.wakkanet.fi/~kaiv/ecasound/">Ecasound</a>. While it's
probably overkill for this project, some of the features I liked were
the built-in audio conversion routines, the ability to specify realtime
scheduling under Linux if run by root, and support for writing data to
stdout. Audio is really a real-time sort of task with hard requirements
on meeting certain scheduling goals, so being able to specify this was
a big plus for Ecasound. Unix pipes also avoids the creation of large
temporary data files keeping disk requirements down to manageable levels.
<p>
<h3>Preparing to Set Up Alsa Sound System</h3>
First things first, identify what kind of sound card you have and
figure out whether it's supported by Alsa. As I said earlier, not all
audio cards are very good for recording. Interestingly enough, the sound
card I ended up using is one of the most inexpensive available and yet
it works quite well. <p>
I ended up using a <a
href="http://alsa-project.org/alsa-doc/doc-php/template.php3?company=Hercules&card=Game+Fortissimo+II&chip=CS4624&module=cs46xx">
Cirrus Logic 46XX</a> (Hercules Fortissmo) series card. I picked one
these up in the sfbay area for ~35USD at retail. I'm pretty sure they're
not much more than that elsewhere. Alsa has pretty good support for
them and for FM recording they work just fine. I had started out with a
CMI8738, an even cheaper card at around ~20USD, but I could not make it
record audio without a horrible whine and very poor input gain. It was
just fine for playback, but pretty much useless as a recording device.
<p>
Detailed instructions for setting up Alsa are on their website listed
card by card. But here are a few notes before you start. Firstly, Alsa
really needs the kernel source you are compiling against and your running
kernel to be the same. So for example, on a typical RedHat installation,
say 2.4.18-26.7, you would need the same kernel sources installed in
your <code>/usr/src/linux-2.4/</code> directory. By default, this is
not the case, because RedHat specifically renames the kernel sources to
use the extra version string "custom".
<p>
To avoid this problem just re-compile, re-install and boot your new
redhat kernel before attempting to install Alsa. If you don't know how
to do this there are lot of good instructions on the net and I suggest
you look some up before proceeding. If you want the default RedHat
options, simply use something like:
<pre>
cd /usr/src/linux-2.4
make mrproper && \
make oldconfig && \
make dep clean bzImage modules MAKE='make -j2'
</pre>
This will rebuild your kernel sources. You will need to install this
and reboot using it. How you do that depends on whether you're using lilo or
grub, and is beyond the scope of these instructions.
<h3>Additional Build Notes For RedHat Kernel Users</h3>
There's also a problem which seems to happen on RedHat 2.4.20 kernels, which
is quite infruriating. I suspect it's because of all the scheduler
patches they've been packporting from the 2.5 series. Anyway, whenever
you run configure it deletes the file include/linux/workqueue.h from the
working directory. This has the unfortunate side effect of letting the
compile proceed cleanly, but refuse to load because of unknown symbols.
Most annoying. The fix is simple. Run configure, and before running
make once again to compile, un-tar the workqueue.h file from the tarball
again. Something like:
<pre>
tar jxvf alsa-driver-0.9.5.tar.bz2 alsa-driver-0.9.5/include/linux/workqueue.h
</pre>
works for the 0.9.5 release. This will prevent the dreaded complaints about
being unable to install modules due to failed dependencies.
<h3>Building and Installing Alsa</h3>
Assuming you've got your new kernel running, download the Alsa drivers
package, and compile and install it as root. Next, download the Alsa
library package, compile and install this. Finally, at a bare minimum
you'll need the Alsa Utils, otherwise you won't be able to do anything
useful like unmute the audio. Tools and OSS compat are nice to have
but not required at this point.
<p>
As an additional note, by default, recent versions of Alsa install
themselves in the default system paths. Older versions installed
themselves in /usr/local, and on RedHat systems this would cause problems
because the dynamic loader wasn't configured to look there for libraries.
This would cause configure scripts to fail to find libraries and
generally not compile. This is actually pretty easy to fix, just
add the /usr/local/lib path to /etc/ld.so.conf and re-run ldconfig.
This will update your ld cache and also dynamic libs that have been
installed there to run. FYI, this is also one of the main reasons why
a lot of open source packages fail to compile on RedHat systems.
<p>
The new drivers will install in your currently running kernel directory.
You will need to reconfigure your modules.conf to reflect the new sound
card set up. This normally involves removing the entries added by kudzu,
or disabling them using a '#' sign and then adding the new driver
entries. Here's the one from my CS46XX setup:
<pre>
# ALSA portion
alias char-major-116 snd cards_limit=1 device_mode=0660
post-install snd alsactl restore
alias snd-card-0 snd-cs46xx
# module options
# OSS/Free portion
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0
# card #1
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
</pre>
Notice the post-install directive. This lets you restore audio settings
on reboots as soon as the driver loads. You can also achieve this by
modifying the <code>/etc/rc.local</code> too, but I like this way better
in case I need to unload the driver. You can also add a pre-remove
directive if you like to save any settings you may have changed before
unloading the sound modules. I prefer to restore to known defaults.
<p>
Next we need to add an entry to the <code>rc.local</code> file. For
whatever reason, the OSS emulation drivers don't load automatically. KDE
complains for example when starting artsd because the sound system hasn't
initialized while it's trying to load. You can force OSS emulation to
pre-load by adding:
<pre>
modprobe snd-pcm-oss
setpci -s 01:09 latency_timer=60
</pre>
to the end of rc.local. The first entry loads the pcm oss driver and
keeps apps which depend on OSS being there to stay none the wiser.
The second entry adjusts the PCI timers for the sound card to give it
a little more time on the bus; that part is optional. I find tweaking
the PCI bus helps avoid pops and clicks in the audio. If you do choose
to tweak your PCI latency this way, remember to use lspci
to find the correct device number for your card. The one listed here
is for my system bus and will likely be different on your system.
<p>
It's probably easiest at this point just to just reboot one more time,
however if you're confident about what you're doing, manually remove
the old OSS audio drivers using <code>rmmod</code> and do a
<pre>modprobe snd-pcm-oss</pre>
Follow up with a <code>lsmod</code> and you should see a lot of bright
and shiny new alsa drivers loaded:
<pre>
Module Size Used by Not tainted
snd-pcm-oss 45668 0
snd-mixer-oss 16536 0 [snd-pcm-oss]
snd-cs46xx 79156 0 (autoclean)
snd-rawmidi 18656 0 (autoclean) [snd-cs46xx]
snd-seq-device 6316 0 (autoclean) [snd-rawmidi]
snd-ac97-codec 44640 0 (autoclean) [snd-cs46xx]
snd-pcm 83264 0 (autoclean) [snd-pcm-oss snd-cs46xx]
snd-timer 19560 0 (autoclean) [snd-pcm]
snd-page-alloc 8520 0 (autoclean) [snd-cs46xx snd-pcm]
gameport 3412 0 (autoclean) [snd-cs46xx]
snd 43140 0 [snd-pcm-oss snd-mixer-oss snd-cs46xx snd-rawmidi snd-seq-device snd-ac97-codec snd-pcm snd-timer]
soundcore 6532 6 [snd]
</pre>
This is an excerpt from a working system. Test it by playing some audio,
anything you have handy will do, like mpg123 for example. Though on a
RedHat system, you'll actually have to download and compile and install
it yourself since they no longer ship mpeg decoders due to patent issues
with Fraunhofer and Philips.
<h2>5.0 Additional Packages to Downloaded</h2>
<h3>Download and Compile ECASOUND</h3>
Since you now have an installed and working alsa sound system, you do have
it working, don't you ? It is now a good time to get ecasound downloaded and
running.
I did my initial implementation using 2.2.1, but I recently upgraded
to 2.2.3 as it seems to have a lot of bugfixes specifically for use with
Alsa. Building it should be fairly straightforward, since it's GNU
autoconf based. Just follow the INSTALL instructions.
<p>
If you want a slightly more optimized build, and you're using a version
of GCC that supports more advanced x86 optimizations, (gcc 3.2 or higher),
I would recommend the following configure line on an PII and above system.
This especially includes the new FPGA2 Celerons.
<pre>
CXXFLAGS='-O2 -march=i686' CFLAGS='-O2 -march=i686' ./configure
</pre>
Or the even more aggressive:
<pre>
CXXFLAGS='-O2 -march=i686 -msse -mmmx' CFLAGS='-O2 -march=i686 -mmmx -msse' ./configure
</pre>
However, be warned this second version may not compile correctly and could
cause more problems than it's worth. On the other hand, it probably
wouldn't hurt to at least give it a try and see if it makes a difference
on your system. In my particular case I see gains in the 2-4% range
with these optimizations.
<h3>Download and Compile Lame</h3>
Now download Lame 3.93.1 and compile that. It's also gnu configure based
so you can use the same flags as we used above. Install it.
I'll also recommend downloading and installing your favorite
mp3 player such as <a href="xmms.org">xmms</a> or <a
href="http://mpg321.sourceforge.net">mpg321</a> as it will be useful
while testing the installation.
<h2>6.0 Configuring The Recording Devices</h2>
This is probably the hardest part of getting this all running. I found
the easiest thing to do was set the volumes before the recording was
going, using the <code>alsamixer</code> tool. It's a curses based
program that lets you adjust sliders for various audio devices and
lets you take a trial and error approach to your particular sound card.
The basic trick is to put the devices you are interested in capturing
from, into capture mode. If anyone has better information on how to
configure this using a command line interface, please drop me a line.
<p>
If you go into the <code>alsamixer</code> interface you'll see a group of
sliders that have values from 0 to 100. Bars which have 6 hyphens above
them are potential capture sources. Because each sound card appears to
have slightly different DACs it's not always clear which ones to activate
to enable recording. <p>
Using a combination of trial and error and <code>ecasound</code>, I was
able to test which devices were capable of recording. Having a pair
of speakers hooked up to the speaker out at this point is very useful,
but headphones would be just as useful at this point too. Typically you
want line-in device. Crank up the volume to around 70%. If you're using
a Video 4 Linux radio you can use the 'radio' util to tune in and turn
on the radio device giving you a source of audio. The Dlink radio is a
line device, meaning it has fixed volume so how loud it sounds will be
directly related to how loud you set the line-in volume.
<P>
If you've hooked it up correctly to the line-in of your sound card
you should now hear some audio. Adjust the volume until it doesn't
sound distorted. Distorted audio will a) sound horrible and b) make
your mp3s sound really crappy. Just play it by ear (sic), and get it to
where it sounds reasonably clear and undistorted. Remember it's FM so
it's already lost about 5KHz of fidelity from being converted, so don't
expect miracles. You may need to look for sources of noise and reposition
your antenna. This will vary from installation to installation.
<h3>Notes on Noise</h3>
Because the source is analog, you really need to pay close attention to
sources of electrical noise, devices such as other computers or monitors
are electrically very noisy. For example, I recently discovered that I
was getting an annoying pulsing static sound from my setup. Turns out
the routing of the audio cable was a little too close to power cords.
A simple re-route solved the problem, but as with a lot of audio you
have to do regular sound checks to make sure you haven't introduced a
new source of interference.
<h2>7.0 Gluing it all together</h2>
So now we have the basic infrastructure going, we need to do some simple
glue scripting to make it all work together. I wrote a couple of
simple scripts to do the functions I needed. The first one is to do
the actual recording. It's started via cron jobs. It simply invokes
all the programs in a big fat pipe with ecasound at the head and lame
at the tail. Works quite well. The name of the file to be created and
any pertinent parameters are passed in via Cron. It's written in bash
and is quite easy to understand.
<h3>Recordshow2: the capture script</h3>
<pre>
#!/bin/bash
echo "Recordshow2 (c)2003 Yan-Fa Li (yanfali@best.com) under GNU LGPL"
# FREQUENCY TIMEINMINS "PROGRAM NAME"
#set -x
tune_channel()
{
echo -n "Tuning to FM Channel $1..."
# Reset and Turn on and Tune Radio
$RADIO -qm 2>/dev/null && sleep 1 && $RADIO -qf $1
}
record_program()
{
echo "Recording $TITLE for $1 Minutes ($TIME seconds) to:"
echo -e "\t$FILENAME"
# Record and Pipe to Lame
TITLE2=${TITLE#*/}
$ARECORD $APARMS | $LAME $LPARMS - "$FILENAME" \
--tt "$TITLE2 on $DATE" \
--ta "KQED/NPR" \
--ty `date +"%Y"` \
--tg 101 \
--tc "$COMMENT"
if [ $? -ne 0 ]
then
echo -n "Error Recording - Check the Soundcard Isn't Recording"
echo " Already"
turn_radio_off
exit 1
fi
}
fix_permissions()
{
# Correct Permissions
if [ -f "$FILENAME" ]
then
chown $OWNER "$FILENAME"
chmod 664 "$FILENAME"
fi
}
turn_radio_off()
{
echo -n "Turning off Radio..."
# Turn off Radio
$RADIO -qm
}
#
# Main Program
#
# Arg Check
if [ $# -ne 3 ]
then
echo "usage: `basename $0` FREQUENCY TIME_IN_MINS \"NAME_OF_PROGRAM\""
exit -1
fi
DEST=/mnt/music/radio
declare -i TIME=$2
TIME=TIME*60
OWNER="yan:music"
RADIO=/usr/bin/radio
ARECORD=/usr/local/bin/ecasound
APARMS="-b 512 -i alsahw,default -o:stdout -t $TIME"
LAME=/usr/local/bin/lame
LPARMS="-r -x -mj -s44.1" # required for ecasound
# -r raw pcm input
# -x swap bytes
# -mj join stereo
# -s incoming sample rate
LPARMS=$LPARMS" -V5 --vbr-new -q0 -b112 --lowpass 15 --cwlimit 10"
# Thanks to: http://www.jthz.com/mp3/ for the settings
# -V5 encoding speed
# --vbr-new
# -q0 highest quality
# -b112 bitrate of 112Kbps
# --lowpass 15 filter all frequencies above 15KHz (FM cutoff)
# --cwlimit 10 acoustic model
DATE=`date +"%a %b %d %Y (%k:%M)"`
SIMPLEDATE=`date +"%Y-%m-%d-%a"`
FILENAME="$DEST/$3-$SIMPLEDATE.mp3"
TITLE="$3"
COMMENT="$1 MHz"
echo "`basename $0`: Recording Started on "$DATE
# Call it twice to avoid radio coming up mute
tune_channel $1
tune_channel $1
record_program $2
fix_permissions
turn_radio_off
echo "`basename $0`: Recording Ended on "`date +"%a %b %e, %Y %k:%M"`
</pre>
<h3>Example Crontab</h3>
<pre>
# usage: recordshow2 FREQUENCY TIME_IN_MINS "NAME_OF_PROGRAM"
# leave a minute at the end otherwise you'll overlap the audio
# device and fail to record
#
# Weekdays
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/etc/radio
MAILTO=root
HOME=/
# Daily
0 9 * * Mon-Fri recordshow2 88.5 59 "Forum/Forum H1"
0 10 * * Mon-Fri recordshow2 88.5 59 "Forum/Forum H2"
0 11 * * Mon-Fri recordshow2 88.5 59 "Talk of the Nation/Talk Of The Nation H1"
0 12 * * Mon-Fri recordshow2 88.5 59 "Talk of the Nation/Talk Of The Nation H2"
0 13 * * Mon-Fri recordshow2 88.5 59 "Fresh Air/Fresh Air"
0 16 * * Mon-Fri recordshow2 88.5 29 "Market Place/Marketplace"
30 16 * * Mon-Fri recordshow2 88.5 119 "All Things Considered/All Things Considered"
0 21 * * Mon-Fri recordshow2 88.5 59 "BBC World Service/BBC World Service"
# Weekly Recordings
# Thursday
30 18 * * Thu recordshow2 88.5 29 "Pacific Time/Pacific Time"
# Saturday
0 11 * * Sat recordshow2 88.5 59 "WaitWait/Wait Wait Don't Tell Me"
0 12 * * Sat recordshow2 88.5 59 "This American Life/This American Life"
0 18 * * Sat recordshow2 88.5 119 "Prarie Home Companion/Prarie Home Companion"
# Sunday - in case you messed up saturday
# Sunday
0 11 * * Sun recordshow2 88.5 119 "Prarie Home Companion/Prarie Home Companion"
# Maintenance
0 1 * * Sun weekly_file_cleanup.rb
</pre>
<h3>File Administration</h3>
The second script is more of a util script. Remember my requirement
about automatically removing files after a certain time ? What this script
does is that it scans the date when the file was created and after a
predetermined time, two weeks in my case, it deletes them. I used ruby,
because I was learning it and it actually made writing the program
quite easy. Go figure. Feel free to re-write it in bash, but it really
was much easier to write it in ruby. See for yourself.
<p>
Because there are some recordings I don't ever want to delete, usually
weekly programs, I added the ability to ignore a directory by simply
writing the file .donotreap into the directory. It'll bail on this
directory if it finds it. As a secondary safe guard it will also only
delete mp3 files. Everything else will be ignored. It's not fancy but
it works quite well.
<pre>
#!/usr/bin/ruby -w
=begin
Simple script to clean up the Timeshifted Radio Directories
Looks for files more than two weeks old and removes them
=end
puts "Timeshifted Radio File Cleaner v0.1"
puts "(c) 2003 Yan-Fa Li (yanfali@best.com) under GNU LGPL"
Dir.chdir("/mnt/raid5/music/radio")
TWOWEEKS = 60 * 60 * 24 * 7 * 2
file_list=Dir["**"]
# Find All Directories
dir_list = []
file_list.each { |x| dir_list << x if File.ftype(x) == "directory" }
topdir = Dir.pwd
# Recurse through all directories
dir_list.each do |x|
Dir.chdir(topdir + "/" + x)
# Do Not Reap Flagged Directories
next if File.zero?(".donotreap")
puts "Entering Directory: #{x}"
# Build File List and Filter on name mp3
file_list=Dir["**"]
puts "\tFound #{file_list.length} Files Total"
file_list.each { |y| file_list.delete(y) if not y.include?("mp3") }
puts "\tFound #{file_list.length} MP3 Files"
# Find Files Older than 2 Weeks
del_list = []
file_list.each { |y|
del_list << y if (Time.now - File.stat(y).mtime) > TWOWEEKS }
puts "\t#{del_list.length} Files Scheduled For Deletion"
next if del_list.length == 0
del_list.each { |z| File.delete(z) }
end
</pre>
<h2>8.0 Bugs and Things To Do</h2>
One recurring problem which I have not been able to fix is that
occasionally the recording will be skewed and sound slightly off.
I haven't been able to figure out what's causing it. Most of the
time the recordings are pristine, but every so often one will be off.
You can still listen to it, but it sounds likes it's slightly off
frequency or tinny. Since I'm streaming the audio straight into the
recording software and then compressing, it could be any one of those
elements in the chain; keeping around large wave files is not an option.
Upgrading to the latest greatest versions has not helped. It could also
be the sound card itself. It doesn't bug me enough to want to fix it,
though I do lose some recordings that way. If anyone out there knows
what it might be, I'd appreciate a heads up.
<p>
Since it pretty much all just works, I haven't messed with it much.
I recently used a lot of the recordings on a long road trip: iPods
rule. But I do have a few ideas on things that would be nice to have.
First, it'd be great to scrape NPR program listings and get the
details for each recording, attaching a reference file to each mp3
or changing the id3 comment to match the program listing.
<p>
Second, a dedicated scheduler would also be great. Right now if you
have a clash in using the recording device, due to overruns, the second
recording fails because the audio device is busy. Having a dedicated
scheduler that is recording centric would pretty much fix this problem.
I know Tivo has something similar so it's obviously a known problem
with known solutions. Cron is the wrong solution for this, so the
work around is of course to deliberately stop recording a minute sooner
than necessary. In general this works very well.
<p>
Third, it would be great to have a web based interface for interacting
with the recordings, changing programs to be recorded and listening,
say via shoutcast, to stuff that's already been recorded. I'm far too
lazy to write it myself, so I leave it as a challenge to all you
out there :D
<h2>9.0 Summary</h2>
As you can see, it's a little bit of work to set up Linux to timeshift
radio, but it's really not that difficult. I've been using it now
for about six months and it's a real pleasure not having to miss any
shows that catch my attention while driving. PBS is a great source of
material and I strongly encourage you to support your local station.
When combined with a portable music player like an iPod, long car rides
become much more enjoyable. <p>
The good news about building one is that things will be getting much
easier in the 2.6 timeframe because of the integration of Alsa sound
system into the mainline kernel. While the files it generates by default
are quite large, you can reduce that footprint by choosing a lower
encoding bitrate than my default of 112kbps. As low as 64kbps should
sound fine for just voice, though music will sound pretty horrible at
this bitrate. I haven't experimented with OGG or any other formats
as I don't have portable players that support alternative formats, but
changing it to support them should be a simple matter of modifying the
backend a bit. <p>
Any <a href="mailto:yanfali@best.com">feedback</a> or comments are appreciated,
and if you have a solution to my occasional bad recordings drop me a line.
<!-- *** BEGIN author bio *** -->
<P>
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2003, Yan-Fa Li.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 94 of <i>Linux Gazette</i>, September 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">USENET groups, email, and ssh tunnels over dial-up connection</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/zhuralev.html">Nokolay Zhuralev</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<p>
When not at work, I have to use a dial-up modem for all my network needs.
However, I still want to have all the power and flexibility that Linux
provides. More importantly, I want to be able to use the same tools at
home that I am used to at work. Namely, slrn for USENET news and fetchmail
for downloading emails. In this article, I am going to discuss the use of
ssh tunnels and compression for efficient and secure delivery of news
and mail over a dial-up connection.
<p>
As it was <a href="http://www.linuxgazette.com/issue15/slrnpull.html">
previously discussed </a>, a combination of slrnpull and 'slrn --spool'
can be used to fetch USENET news and read them offline.
This is especially useful when there is only one user,
and she is stuck with pay-per-hour dial-up connection.
Let's look more closely into this issue.
<p>
First, one should avoid working under root as much as possible,
and use sudo instead. Use <code>visudo</code> to edit /etc/sudoers and add the following lines
at the bottom:
<pre>
# we want to be specific here
jane localhost=/usr/bin/slrnpull -h news.server.com
</pre>
where jane is the username authorized to run the command
<code>slrnpull -h news.server.com</code> from localhost.
Whenever Jane needs to fetch the news, she runs sudo:
<pre>
jane@localhost ~$ sudo slrnpull -h news.server.com
Password:
jane@localhost ~$ slrn --spool
</pre>
<p>
Fetching a large number of articles from a wide
variety of USENET groups can take quite some time.
Let us consider a scenario where Jane has ssh access
to a machine with fast Internet. This could be a machine at
work, at school, or even abroad. Assuming that the other machine
can access news.server.com, and provided that there are no
other obstacles (for ex. strict firewalling), an ssh tunnel
with compression can be used to significantly speed up the news fetching,
when done over a dial-up connection. A tunnel is established like this:
<pre>
jane@localhost ~$ ssh -C -N -f -L 8081:news.server.com:119 janedoe@work.some.com
jane@localhost ~$
</pre>
Here -C is for compression, -N and -f avoid executing the remote command
and send ssh to background, and -L is for local port forwarding.
Now, the lines in /etc/sudoers need to be adjusted to make use of the
tunnel:
<pre>
# we want to be specific here
#jane localhost=/usr/bin/slrnpull -h news.server.com
# notice the use of backslash
jane localhost=/usr/bin/slrnpull -h localhost\:8081
</pre>
<p>
Jane can now run slrnpull. Instead of trying to connect to
news.server.com directly, slrnpull will connect to local port 8081 and
the traffic will travels through an ssh tunnel between localhost
and work.some.com.
<pre>
jane@localhost ~$ sudo slrnpull -h localhost:8081
Password:
jane@localhost ~$ slrn --spool
</pre>
<p>
The two machines, i.e. the news server news.server.com and the
work.some.com, are on the fast network. The connection between them
is in clear-text and is not compressed. However, the localhost is
connected to work.some.com via dial-up. The traffic between the
later two is encrypted and compressed. The compression is the same
as the one used by gzip. Compression of the ASCII traffic greatly decreases
the download times, which is especially useful if one likes to
subscribe to a lot of USENET groups. The proposed scheme also
provides some privacy for Jane, since the traffic between her machine
and work.some.com is encrypted.
<p>
Finally, to avoid typing long ssh commands to establish a
tunnel, Jane could have something like this in her .ssh/config file:
<pre>
Host work
HostName work.some.com
LocalForward 8081 news.server.com:119
IdentityFile /home/janedoe/.ssh/id_dsa
Protocol 2
User janedoe
CompressionLevel 6
</pre>
Notice that there is only one colon sign in the LocalForward line above.
Now the tunnel can be established with just:
<pre>
jane@localhost ~$ ssh -C -N -f work
</pre>
<p>
Just don't forget to kill the old ssh tunnel before establishing a new one.
If in doubt, use <code>netstat -tupan | grep LIS</code> to see what is
going on. The exact syntax of the commands may depend on the particular
flavor of SSH that you have. The above works for me (RH 9, openssh-3.5p1-1).
Also check out the article on
<a href="http://www.linuxgazette.com/issue67/nazario2.html"> ssh-agent </a>,
which makes dealing with ssh even less painless.
<p>
In a similar fashion, ssh tunnels can be used in combination with
fetchmail to retrieve email from the server. Just add a new LocalForward
entry to the .ssh/config file:
<pre>
Host work
HostName work.some.com
LocalForward 8081 news.server.com:119
LocalForward 8082 pop3.some.com:110
IdentityFile /home/janedoe/.ssh/id_dsa
Protocol 2
User janedoe
CompressionLevel 6
</pre>
and edit .fetchmailrc accordingly:
<pre>
poll localhost with proto POP3 port 8082
user 'Doe0001' there with password "blah" is 'jane' here options fetchall
</pre>
So, now the command <code> ssh -C -N -f work </code> will establish
two tunnels, one for the news and one for the pop3 mail.
Fire the fetchmail to see how it works:
<pre>
fetchmail -e 50 -m "/usr/sbin/sendmail -oem -f %F %T"
</pre>
To learn more about fetchmail and setting up the email system
check the <a href="http://www.linuxgazette.com/issue92/okopnik.html">
recent issue</a> of LG.
My experience was that, on average, mail and news get downloaded
at least twice as fast comparing to the conventional methods.
Over a modem line, that is.
To summarize, the use of ssh tunnels with compression provides
both efficiency and security for your everyday communication.
Use it, love it, and pass the knowledge along ;)
<!-- *** BEGIN author bio *** -->
<P>
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
Born in Moscow, Russia, in 1976. I have been coding and/or messing
with computers in one way or another since I was 12.
I have entered the realm of *nix in 1995, and I never regretted it.
Currently, I am a Ph.D. student in the Department of Chemistry at
the University of Minnesota, MN.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2003, Nokolay Zhuralev.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 94 of <i>Linux Gazette</i>, September 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Python Weather Station</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/hughes.html">Phil Hughes</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
This program is a simple interface that allows you to
build a web page from the Metar data output from
weather stations around the world.
I wouldn't call it exciting but it does work.
<p>
Rather than try to describe what you will see, go <a
href="http://pictures.fylz.com/weather.html">here</a>
and take a look. You should see at least two and
possibly as many as five weather reports from around
Costa Rica.
That is, the program has a list of five weather
stations to check and displays the information from
all that report.
<h2>System Structure</h2>
<p>
The heart of this system is the Pymetar package
available <a href="http://www.schwarzvogel.de/software-pymetar.shtml">
here</a>.
This is a Python program which fetches Metar data
described <a href="http://www.noaa.gov"> here</a>.
Pymetar is a command-line tool but it does all the
dirtywork.
<p>
My goal is to make this information available on a
web page.
I didn't want to turn this into a huge programming
project but I want the implementation to make sense.
The most basic approach would have been to run the
program as a CGI script for each request. However,
this was potentially very inefficient because it
would require the program to grab all the data each
time a CGI request came in.
More important, it would mean the user would have to
wait for all these requests to complete.
<p>
I decided the best compromise was to set up a cron
job to fetch the data and build a weather page.
Then, each page request would just be displaying a
static page.
As the weather data does not change all that often,
this actually offers pretty much current information.
<h2>Implementation</h2>
<p>
First, here is the code:
<pre>
#!/usr/bin/env python
import sys
import time
sys.path.insert(0, "/home/fyl/pymetar-0.5")
import pymetar
def stations(args):
for arg in map(lambda x: x.strip(), args):
try:
weather = pymetar.MetarReport(arg)
except IOError, msg:
# uncomment the following and remove pass line to see the errors
# sys.stderr.write("Problem accessing the weather server: %s\n" % msg)
pass
else:
if weather.valid:
print "<h3>"
print weather.getStationName()
print " ( Lat: %s, Long: %s, Alt: %s m)" % \
weather.getStationPosition()
print "</h3>"
print "<table border=\"2\">"
print "<tr><td>Updated</td><td> %s</td></tr>" % \
weather.getTime()
if weather.getWindDirection() is not None:
print "<tr><td>Wind direction</td><td> %s</td></tr>" % \
weather.getWindDirection()
if weather.getWindSpeed() is not None:
print "<tr><td>Wind speed</td><td> %6.1f m/s</td></tr>" % \
weather.getWindSpeed()
if weather.getTemperatureCelsius() is not None:
print "<tr><td>Temperature</td><td> %.1fC (%.1fF)</td></tr>" % \
(weather.getTemperatureCelsius(), \
weather.getTemperatureFahrenheit())
if weather.getDewPointCelsius() is not None:
print "<tr><td>Dew point</td><td> %.1fC (%.1fF)</td></tr>" % \
(weather.getDewPointCelsius(), \
weather.getDewPointFahrenheit())
if weather.getHumidity() is not None:
print "<tr><td>Humidity</td><td> %.0f%%</td></tr>" % \
weather.getHumidity()
if weather.getVisibilityKilometers() is not None:
print "<tr><td>Visibility</td><td> %.1f Km</td></tr>" % \
weather.getVisibilityKilometers()
if weather.getPressure() is not None:
print "<tr><td>Pressure</td><td> %.0f hPa</td></tr>" % \
weather.getPressure()
if weather.getWeather() is not None:
print "<tr><td>Weather</td><td> %s</td></tr>" % \
weather.getWeather()
if weather.getSkyConditions() is not None:
print "<tr><td>Sky conditions</td><td> %s</td></tr>" % \
weather.getSkyConditions()
print "</table>"
else:
print "Either %s is not a valid station ID, " % arg
print "the NOAA server is down or parsing is severely broken."
print "<html>"
print "<head>"
print "<title>Costa Rica weather from PlazaCR.com</title>"
print "</head>"
print "<body>"
print "<h1>Costa Rica weather from PlazaCR.com</h1>"
print "<p>Latest reports as of %s CST" % time.ctime()
gm = time.gmtime()
print "(%d.%02d.%02d %02d%02d UTC)" % (gm[0], gm[1], gm[2], gm[3], gm[4])
print '<p><a href="images/costa_rica.gif" target="_blank">Costa Rica map</a>'
stations(["MROC", "MRLM", "MRCH", "MRLB", "MRPV"])
print "</body>"
print "</html>"
</pre>
<p>
I chose to just import the pymetar.py code in the
wrapper than generated the HTML page.
To do this, I added the Pymetar directy to the path
being searched by Python.
<p>
Next I define <b>stations</b>, a function that queries the
weather stations using the Pymetar code and then
formats the output into HTML.
It looks pretty ugly because it is just some long
print statements building HTML strings with some if
statements tossed in to see if we actually got the
data.
The important point is that you pass it a list of the
station names and you get the body of the web page
back.
<p>
Finally, the last maybe 15 lines of code just build
the HTML boilerplace and call stations to produce
the guts.
<h2>Testing and Installation</h2>
<p>
Because of the design, testing is very easy.
There are no web-based dependencies in the design so
you can just run the program from the command line.
<p>
In my case, I called the program wcr, so just typing
./wcr will run the program and display the HTML on
standard output.
If all goes well, run the program again, redirecting
the output to a file. For example,
<pre>
./wcr > /tmp/weather.html
</pre>
<p>
You can now point a web browser at the file and see
if it renders the page the way you want.
If not, now is the time to make changes in wcr and
continue testing.
<p>
Once you are happy with the output, upload the code
to your web server and set up a cron job to run it.
Normally, crontab -e will allow you to edit your
crontab entry.
<p>
I elected to run the program twice an hour, at 5 and
35 minutes past.
The crontab entry must execute the program and write
the output file to a location the web server can get
to. I used:
<pre>
5,35 * * * * /home/fyl/pymetar-0.5/bin/wcr > /var/www/htdocs/weather.html
</pre>
<p>
The four asterisks tell cron that the 5 and 35 minute
times apply to every hour of every day.
The next field is the name of the program to run.
Finally the redirect operator (>) is followed by
location where the HTML file is to be stored.
<p>
Assuming you set all the permissions right--that is,
the program can write to the file and the web server
can read the file, you are all done.
Just point to this file and you have a weather page.
<h2>Conclusion</h2>
<p>
For the perfectionist, you probably need a fancier
soluution.
Why?
Well, there will be a point in time when the contents
of the HTML file will not be valid.
When cron fires of the job the contents of the output
file are truncated.
Then the program runs and builds a new file.
<p>
Because of the way the program works this time is
not just a short execution time of some Python code
as the program queries the various weather stations
and has to wait for a response.
With the five stations I poll, I see elapsed times
between one and ten seconds.
If having bad data on the site for a maximum of 10
seconds every 30 minutes is acceptable to you, all is
well.
If not, write the output to a temporary file and then
move it to the real file when all is done.
Still not perfect but really close.
<p>
Now, for us mortals, we have a quick and dirty
weather page. Have fun.
--
Phil Hughes, fyl@a42.com Phone/FAX: 506-483-1265
Aptdo. 89-4060, Alajuela, Costa Rica
<!-- *** BEGIN author bio *** -->
<P>
<P>
Phil Hughes is the publisher of <I>Linux Journal</I>, and thereby <I>Linux
Gazette</I>. He dreams of permanently tele-commuting from his home on the
Pacific coast of the Olympic Peninsula.
As an employer, he is "Vicious, Evil,
Mean, & Nasty, but kind of mellow" as a boss should be.
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2003, Phil Hughes.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 94 of <i>Linux Gazette</i>, September 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">SCO Interview</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/anonymous.html">Anonymous</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
This is Bob Chumps, President of Chumps News Network. We're here today
for our Washington Insider Interview Luncheon with Baryl O'Hubris,
President of the Sexy Condom Operation Corp.
<p>
CNN: Baryl, you're controversial suit has been in the news a lot lately.
Can you give us a little background? Where did you first get the idea
for all this?
<p>
Baryl: Well, we'd been talking one day in the board room about how we
didn't have a lawyer's chance in hell in making any money over the next
five years. All these new glow-in-the dark and French tickler designs
have really screwed up our market, so to speak; we just don't have the
R&D funding to get any of this done by our group, and we couldn't
compete if we had to license them from anyone else. It looked bleak. I was
so bummed, I went home and tried to take my mind off the whole situation.
I had just picked up a copy of that new Open Source biography, "Pulling
the Wool: Adventures With Our Own Bush". Well, I couldn't relax and
concentrate, so I took a viagra, two peyote buttons, and did a couple of
lines. I felt better immediately and went back to reading. After the
chapter on doing up the election, a small idea was forming. When I got to
the part about 9/11, I could really feel it taking hold. By the time I got
to the chapter called "Bombing the Browns & Marketing the Oil War", I
couldn't contain it any longer. I could see it all, people in the US have
been prepared for this type of thing for years. We could do it!
<p>
CNN: What happened then?
<p>
Baryl: I immediately called Pukinda Djellow, our Chairman of the Board.
"Puke," I said. "Get the lawyers in here tomorrow. I've got an idea."
Puke listened, told me it was brilliant, that I'm a genius, emphasized
just how amazing I am; he's great, a real team player. We met the next
day and formed our basic plan.
<p>
We had the lawyers take apart the licensing agreement on our condom
packs. It couldn't be clearer, Bob. The way it's written, if you've used
one of our prophylactics, you've implicitly agreed that we have a
license on your having sex for the rest of your life. We had been
sitting on a gold mine without even knowing it!
<p>
Basically, the way the lawyers have it, anytime you slide an SCO scumbag
on your schlong, you owe us more money. So the lawyers worked
feverishly, came up with the idea for a *big* suit. Now, we knew we
couldn't identify individual purchasers of our condoms, the Total
Information Awareness thing isn't quite up yet. So, we just sued
everybody. It's the Kill 'em All, Let Moroni Sort 'em Out approach.
Eventually everyone's going to either pay up or pack their peter away
for good.
<p>
CNN: Didn't anyone object?
<p>
Baryl: Sure, one guy, Uphinder Bowwow didn't like it and quit. We don't
need him, it's no big deal.
<p>
CNN: Yes, but how are you really going to make money? Eventually people
are going to figure this out!
<p>
Baryl: That's the brilliant part. We knew it would take years for the
whole thing to get to court. In the meantime, we could be reduced to
drinking T-Bird. We had to find a way to cash in faster. Well, I
remembered we'd hired this guy named Veg Roughage, VP of Worldwide
Intercourse, which of course left him with not a whole lot to do. We
brought him into the meeting. Turns out he's had some past experience in
this stuff, knows how to do the stock and option thing. He said it was
really simple, came up with this plan how we could issue options to all
of us who were "in the know". Got him off his duff and on to something
he knows about. Ya know, it worked; as soon as we made the announcement,
our stock took off. We're all rolling in dough now, no thoughts of
having to drink the cheap stuff anymore!
<p>
CNN: All of this seems a little far-fetched.
<p>
Baryl: After I came down the first time, I thought so too, Bob. I was
frankly worried. But, I just did the same mix again: viagra, peyote, and
toot, and soon relized everything was Ok. And it's working! The main
thing is keeping up the hype, keeping the general public and the
employees confused but motivated.
<p>
CNN: How did you do that?
<p>
Baryl: Well, it turns out to be pretty simple. First of all, we hired
professional script writers so we all know what to say all the time;
sort of synchronizes our processes so to speak. Then, we call regular
press and phone conferences. Krisp Blaughjob, Senior VP, has been a
leader in this area, bought himself a couple of nice Armanis and some
new ties. When he wears that outfit, everyone believes anything he says,
I'm sure you've seen him on TV. Of course, the other employees were
still a problem, but I figured that one out myself. Since everyone eats
at the SCO cafeteria, we just put up some cool subliminal motivational
posters and spiked the food with my mix. Of course, we couldn't afford
coke for everyone, so we knocked it out of my original recipe and
substituted 2,000 milligrams of caffeine. Does a pretty good job, costs
about 98% less.
<p>
CNN: I guess you can't argue with success. What do you think you're
biggest problem is going to be in all this?
<p>
Baryl: So far, it's been clear sailing inside the US, so we're
concentrating on that market. We're realistic, we know we can't control
the world yet, they just haven't been properly prepared. Domestically
the media has really made our job easy.
<p>
Our biggest concern is that most people will just switch to
masturbation. Right now, we don't know how to handle that one for sure.
But we've got the script writers doing research. Turns out with the
right ads, we can probably convince most people that it really does grow
hair on your palms and eventually cause blindness.
<p>
CNN: Wow, the whole thing is amazing. Any last comments?
<p>
Baryl: Well, I'd just like to thank God people are stupid. Oh yeah, the
lawyers think it's really funny: all those people who bought our stock
(symbol SCOC) are going to be known as SCOC suckers.
<!-- *** BEGIN author bio *** -->
<P>
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
Anonymous,...
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2003, Anonymous.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 94 of <i>Linux Gazette</i>, September 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
</BODY></HTML>
|