Rev 9337 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9337 | Rev 9342 | ||
---|---|---|---|
Line 305... | Line 305... | ||
305 | if (argc != 2) { |
305 | if (argc != 2) { |
306 | fputs(usage, fout); |
306 | fputs(usage, fout); |
307 | return; |
307 | return; |
308 | } |
308 | } |
309 | const char *fname = argv[1]; |
309 | const char *fname = argv[1]; |
310 | FILE *f = fopen(fname, "r"); |
310 | FILE *f = fopen(fname, "rb"); |
311 | if (!f) { |
311 | if (!f) { |
312 | fprintf(fout, "[!] can't open file '%s': %s\n", fname, strerror(errno)); |
312 | fprintf(fout, "[!] can't open file '%s': %s\n", fname, strerror(errno)); |
313 | return; |
313 | return; |
314 | } |
314 | } |
315 | fseek(f, 0, SEEK_END); |
315 | fseek(f, 0, SEEK_END); |
Line 1091... | Line 1091... | ||
1091 | " y y coord"; |
1091 | " y y coord"; |
1092 | if (argc != 6) { |
1092 | if (argc != 6) { |
1093 | fputs(usage, fout); |
1093 | fputs(usage, fout); |
1094 | return; |
1094 | return; |
1095 | } |
1095 | } |
1096 | FILE *f = fopen(argv[1], "r"); |
1096 | FILE *f = fopen(argv[1], "rb"); |
1097 | fseek(f, 0, SEEK_END); |
1097 | fseek(f, 0, SEEK_END); |
1098 | size_t fsize = ftell(f); |
1098 | size_t fsize = ftell(f); |
1099 | rewind(f); |
1099 | rewind(f); |
1100 | uint8_t *image = (uint8_t*)malloc(fsize); |
1100 | uint8_t *image = (uint8_t*)malloc(fsize); |
1101 | fread(image, fsize, 1, f); |
1101 | fread(image, fsize, 1, f); |
Line 1124... | Line 1124... | ||
1124 | " row_offset in bytes"; |
1124 | " row_offset in bytes"; |
1125 | if (argc != 8) { |
1125 | if (argc != 8) { |
1126 | fputs(usage, fout); |
1126 | fputs(usage, fout); |
1127 | return; |
1127 | return; |
1128 | } |
1128 | } |
1129 | FILE *f = fopen(argv[1], "r"); |
1129 | FILE *f = fopen(argv[1], "rb"); |
1130 | fseek(f, 0, SEEK_END); |
1130 | fseek(f, 0, SEEK_END); |
1131 | size_t fsize = ftell(f); |
1131 | size_t fsize = ftell(f); |
1132 | rewind(f); |
1132 | rewind(f); |
1133 | uint8_t *image = (uint8_t*)malloc(fsize); |
1133 | uint8_t *image = (uint8_t*)malloc(fsize); |
1134 | fread(image, fsize, 1, f); |
1134 | fread(image, fsize, 1, f); |
Line 1330... | Line 1330... | ||
1330 | if (argc != 15) { |
1330 | if (argc != 15) { |
1331 | fputs(usage, fout); |
1331 | fputs(usage, fout); |
1332 | return; |
1332 | return; |
1333 | } |
1333 | } |
1334 | const char *fname = argv[1]; |
1334 | const char *fname = argv[1]; |
1335 | FILE *f = fopen(fname, "r"); |
1335 | FILE *f = fopen(fname, "rb"); |
1336 | if (!f) { |
1336 | if (!f) { |
1337 | fprintf(fout, "[!] can't open file '%s': %s\n", fname, strerror(errno)); |
1337 | fprintf(fout, "[!] can't open file '%s': %s\n", fname, strerror(errno)); |
1338 | return; |
1338 | return; |
1339 | } |
1339 | } |
1340 | fseek(f, 0, SEEK_END); |
1340 | fseek(f, 0, SEEK_END); |
Line 1761... | Line 1761... | ||
1761 | " file path/to/local/file.aml"; |
1761 | " file path/to/local/file.aml"; |
1762 | if (argc != 2) { |
1762 | if (argc != 2) { |
1763 | fputs(usage, fout); |
1763 | fputs(usage, fout); |
1764 | return; |
1764 | return; |
1765 | } |
1765 | } |
1766 | FILE *f = fopen(argv[1], "r"); |
1766 | FILE *f = fopen(argv[1], "rb"); |
1767 | if (!f) { |
1767 | if (!f) { |
1768 | fprintf(fout, "[umka] can't open file: %s\n", argv[1]); |
1768 | fprintf(fout, "[umka] can't open file: %s\n", argv[1]); |
1769 | return; |
1769 | return; |
1770 | } |
1770 | } |
1771 | fseek(f, 0, SEEK_END); |
1771 | fseek(f, 0, SEEK_END); |
Line 1779... | Line 1779... | ||
1779 | kos_acpi_ssdt_size[kos_acpi_ssdt_cnt] = fsize; |
1779 | kos_acpi_ssdt_size[kos_acpi_ssdt_cnt] = fsize; |
1780 | kos_acpi_ssdt_cnt++; |
1780 | kos_acpi_ssdt_cnt++; |
1781 | } |
1781 | } |
Line 1782... | Line 1782... | ||
1782 | 1782 | ||
1783 | static void |
- | |
1784 | shell_pci_set_path(int argc, char **argv) { |
- | |
1785 | const char *usage = \ |
- | |
1786 | "usage: pci_set_path |
- | |
1787 | " path where aaaa:bb:cc.d dirs are"; |
- | |
1788 | if (argc != 2) { |
- | |
1789 | fputs(usage, fout); |
- | |
1790 | return; |
- | |
1791 | } |
- | |
1792 | strcpy(pci_path, argv[1]); |
- | |
1793 | } |
- | |
1794 | - | ||
1795 | static void |
- | |
1796 | shell_pci_get_path(int argc, char **argv) { |
- | |
1797 | (void)argv; |
- | |
1798 | const char *usage = \ |
- | |
1799 | "usage: pci_get_path"; |
- | |
1800 | if (argc != 1) { |
- | |
1801 | fputs(usage, fout); |
- | |
1802 | return; |
- | |
1803 | } |
- | |
1804 | fprintf(fout, "pci path: %s\n", pci_path); |
- | |
1805 | } |
- | |
1806 | - | ||
1807 | static void |
1783 | static void |
1808 | shell_bg_set_size(int argc, char **argv) { |
1784 | shell_bg_set_size(int argc, char **argv) { |
1809 | const char *usage = \ |
1785 | const char *usage = \ |
1810 | "usage: bg_set_size |
1786 | "usage: bg_set_size |
1811 | " xsize in pixels\n" |
1787 | " xsize in pixels\n" |
Line 1867... | Line 1843... | ||
1867 | " offset in bytes, (x+y*xsize)*3\n"; |
1843 | " offset in bytes, (x+y*xsize)*3\n"; |
1868 | if (argc != 4) { |
1844 | if (argc != 4) { |
1869 | fputs(usage, fout); |
1845 | fputs(usage, fout); |
1870 | return; |
1846 | return; |
1871 | } |
1847 | } |
1872 | FILE *f = fopen(argv[1], "r"); |
1848 | FILE *f = fopen(argv[1], "rb"); |
1873 | fseek(f, 0, SEEK_END); |
1849 | fseek(f, 0, SEEK_END); |
1874 | size_t fsize = ftell(f); |
1850 | size_t fsize = ftell(f); |
1875 | rewind(f); |
1851 | rewind(f); |
1876 | uint8_t *image = (uint8_t*)malloc(fsize); |
1852 | uint8_t *image = (uint8_t*)malloc(fsize); |
1877 | fread(image, fsize, 1, f); |
1853 | fread(image, fsize, 1, f); |
Line 1947... | Line 1923... | ||
1947 | { "i40", shell_i40 }, |
1923 | { "i40", shell_i40 }, |
1948 | { "ls70", shell_ls70 }, |
1924 | { "ls70", shell_ls70 }, |
1949 | { "ls80", shell_ls80 }, |
1925 | { "ls80", shell_ls80 }, |
1950 | { "move_window", shell_move_window }, |
1926 | { "move_window", shell_move_window }, |
1951 | { "mouse_move", shell_mouse_move }, |
1927 | { "mouse_move", shell_mouse_move }, |
1952 | { "pci_get_path", shell_pci_get_path }, |
- | |
1953 | { "pci_set_path", shell_pci_set_path }, |
- | |
1954 | { "process_info", shell_process_info }, |
1928 | { "process_info", shell_process_info }, |
1955 | { "put_image", shell_put_image }, |
1929 | { "put_image", shell_put_image }, |
1956 | { "put_image_palette", shell_put_image_palette }, |
1930 | { "put_image_palette", shell_put_image_palette }, |
1957 | { "pwd", shell_pwd }, |
1931 | { "pwd", shell_pwd }, |
1958 | { "ramdisk_init", shell_ramdisk_init }, |
1932 | { "ramdisk_init", shell_ramdisk_init }, |