]> git.proxmox.com Git - grub2.git/blame - ChangeLog
2005-08-01 Yoshinori K. Okuji <okuji@enbug.org>
[grub2.git] / ChangeLog
CommitLineData
8b5f3938 12005-08-01 Yoshinori K. Okuji <okuji@enbug.org>
2
3 * DISTLIST: Added util/i386/pc/grub-probefs.c.
4
5 * conf/i386-pc.rmk (sbin_UTILITIES): Added grub-probefs.
6 (grub_setup_SOURCES): Removed partmap/amiga.c, partmap/apple.c and
7 partmap/sun.c.
8 (grub_probefs_SOURCES): New variable.
9
10 * util/i386/pc/grub-probefs.c: New file.
11
12 * util/i386/pc/grub-setup.c (main): Call
13 grub_pc_partition_map_init, grub_ufs_init, grub_minix_init,
14 grub_hfs_init and grub_jfs_init to initialize the system. Call
15 grub_ufs_fini, grub_minix_fini, grub_hfs_fini, grub_jfs_init and
16 grub_pc_partition_map_fini to finish the system.
17
ea409713 182005-07-31 Yoshinori K. Okuji <okuji@enbug.org>
19
20 * loader/i386/pc/multiboot.c (grub_multiboot_is_elf32): New
21 function.
22 (grub_multiboot_load_elf32): Likewise.
23 (grub_multiboot_is_elf64): Likewise.
24 (grub_multiboot_load_elf64): Likewise.
25 (grub_multiboot_load_elf): Likewise.
26 (grub_rescue_cmd_multiboot): Call grub_multiboot_load_elf to load
27 an ELF32 or ELF64 file.
28 This is based on a patch from Ruslan Nikolaev <nruslan@mail.com>.
29
30 From Serbinenko Vladimir <serbinenko.vova@list.ru>:
31 * kern/disk.c (grub_print_partinfo): Check if FS->LABEL is not
32 NULL before calling FS->LABEL.
33 * fs/fat.c (grub_fat_dir): Initialize DIRNAME to NULL.
34 * commands/ls.c (grub_ls_list_files): Show labels, if possible.
35 (grub_ls_list_disks): Check if FS and FS->LABEL are not NULL
36 before calling FS->LABEL.
37
141a288b 382005-07-26 Yoshinori K. Okuji <okuji@enbug.org>
39
40 * util/i386/pc/grub-install.in (datadir): New variable.
41 (libdir): Removed.
42 (pkgdatadir): New variable.
43 (pkglibdir): Removed.
44
0d5f8a54 452005-07-24 Yoshinori K. Okuji <okuji@enbug.org>
46
47 * DISTLIST: Added util/i386/pc/grub-install.in.
48
49 * util/i386/pc/grub-install.in: New file.
50
51 * conf/i386-pc.rmk (sbin_SCRIPTS): New variable.
52 (grub_install_SOURCES): Likewise.
53
54 * genmk.rb: Added support for scripts.
55 (Script): New class.
56 (scripts): New variable.
57
58 * Makefile.in (install-local): Install sbin_SCRIPTS by
59 INSTALL_SCRIPT.
60 (uninstall): Remove sbin_SCRIPTS.
61
62 * util/i386/pc/grub-setup.c (main): If the argument is not a GRUB
63 device, try to get a GRUB device by
64 grub_util_biosdisk_get_grub_dev.
65 Free DEST_DEV.
66
67 * util/i386/pc/grub-mkdevicemap.c (usage): Remove a duplicated
68 description for --device-map.
69
5f968e1e 702005-07-20 Yoshinori K. Okuji <okuji@enbug.org>
71
72 Change the semantics of variable hooks. They now return strings
73 instead of error values.
74
75 * util/i386/pc/grub-setup.c: Include grub/env.h.
76 (setup): Use grub_device_set_root instead of grub_env_set.
77
78 * kern/rescue.c (grub_rescue_cmd_root): Use grub_env_set and
79 grub_env_get instead of grub_device_set_root and
80 grub_device_get_root, respectively.
81
82 * kern/main.c (grub_env_write_root): New function.
83 (grub_set_root_dev): Register grub_env_write_hook for "root". Use
84 grub_env_set instead of grub_device_set_root.
85
86 * kern/env.c (HASHSZ): Reduced to 13, because GRUB does not need
87 many variables.
88 (grub_env_set): Set ENV->VALUE to the result of ENV->WRITE_HOOK
89 rather than calling ENV->WRITE_HOOK afterwards.
90 (grub_env_get): Return the result of ENV->READ_HOOK rather than
91 passing a pointer of a pointer.
92 (grub_register_variable_hook): Change the types of "read_hook" and
93 "write_hook" to grub_env_read_hook_t and grub_env_write_hook_t,
94 respectively.
95 Allocate the default empty string on the heap, because this string
96 may be freed later.
97
98 * kern/device.c: Include grub/env.h.
99 (grub_device_set_root): Removed.
100 (grub_device_get_root): Likewise.
101 (grub_device_open): Use grub_env_get instead of
102 grub_device_get_root.
103
104 * include/grub/env.h (grub_env_read_hook_t): New type.
105 (grub_env_write_hook_t): Likewise.
106 (grub_env_var): Change the types of "read_hook" and "write_hook"
107 to grub_env_read_hook_t and grub_env_write_hook_t, respectively.
108 (grub_register_variable_hook): Likewise.
109
110 * include/grub/device.h (grub_device_set_root): Removed.
111 (grub_device_set_root): Likewise.
112
113 * fs/fat.c (grub_fat_dir): Make a copy of PATH in DIRNAME, and
114 make sure that DIRNAME terminates with '/', so that
115 grub_fat_find_dir will fail if PATH is not a directory.
116
117 * commands/ls.c (grub_ls_list_files): Remove the qualifier const
118 from DIRNAME.
119 Use the qualifier auto for print_files and print_files_long.
120 If FS->DIR sets GRUB_ERRNO to GRUB_ERR_BAD_FILE_TYPE, try DIRNAME
121 as a regular file.
122 Put a newline only if there is no error.
123 (grub_cmd_ls): Remove grub_ls_print_files, because this is not
124 used.
125
896f0afd 1262005-07-20 Yoshinori K. Okuji <okuji@enbug.org>
127
128 * kern/partition.c (grub_partition_probe): Initialize PART to
129 NULL. Otherwise, when no partition map is registered, this returns
130 a garbage.
131
b28b81b2 1322005-07-19 Yoshinori K. Okuji <okuji@enbug.org>
133
134 * partmap/apple.c (apple_partition_map_iterate): Check if POS
135 equals GRUB_DISK_SECTOR_SIZE to see if the partition table is
136 valid.
137
5f3607e0 1382005-07-18 Yoshinori K. Okuji <okuji@enbug.org>
139
140 * commands/ls.c (grub_ls_list_disks): Print the filesystem
141 information on each device, if it does not have partitions. Print
142 "Device" instead of "Disk", because this function is not specific
143 to disk devices.
144
145 * normal/main.c (grub_rescue_cmd_normal): Make the variable CONFIG
146 static to ensure that it is put on the memory rather than a
147 register.
148
502c87e8 1492005-07-17 Yoshinori Okuji <okuji@enbug.org>
150
151 * commands/cat.c (GRUB_MOD_INIT): Use better documentation.
152 (grub_cat_init): Likewise.
153 * loader/i386/pc/chainloader_normal.c (GRUB_MOD_INIT): Likewise.
154 (options): Likewise.
155 * commands/configfile.c (GRUB_MOD_INIT): Likewise.
156 (grub_configfile_init): Likewise.
157 * font/manager.c (GRUB_MOD_INIT): Likewise.
158 * commands/help.c (GRUB_MOD_INIT): Likewise.
159 (grub_help_init): Likewise.
160 * normal/command.c (grub_command_init): Likewise.
161 * loader/i386/pc/linux_normal.c (GRUB_MOD_INIT): Likewise.
162 * disk/loopback.c (grub_loop_init): Likewise.
163 (GRUB_MOD_INIT): Likewise.
164 * commands/ls.c (grub_ls_init): Likewise.
165 (GRUB_MOD_INIT): Likewise.
166 (options): Likewise.
167 * commands/boot.c (grub_boot_init): Likewise.
168 (GRUB_MOD_INIT): Likewise.
169 * loader/i386/pc/multiboot_normal.c (GRUB_MOD_INIT): Likewise.
170 * commands/i386/pc/reboot.c (grub_reboot_init): Likewise.
171 (GRUB_MOD_INIT): Likewise.
172 * commands/cmp.c (grub_cmp_init): Likewise.
173 (GRUB_MOD_INIT): Likewise.
174
175 * normal/arg.c: Use <> instead of "" to include header files.
176 (SHORT_ARG_HELP): New macro.
177 (SHORT_ARG_USAGE): Likewise.
178 (help_options): Specify SHORT_ARG_HELP and SHORT_ARG_USAGE instead
179 of 'h' and 'u' for help and usage, respectively. Use more GNU-like
180 descriptions.
181 (find_short): Check if C is 'h' or 'u' explicitly.
182 (grub_arg_show_help): Use space characters instead of tabs. Treat
183 SHORT_ARG_HELP and SHORT_ARG_USAGE exceptionally so that -h and -u
184 are shown with --help and --usage only if they are not used for
185 the command itself.
186 (parse_option): Use SHORT_ARG_HELP and SHORT_ARG_USAGE instead of
187 'h' and 'u'.
188
189 * include/grub/arg.h (struct grub_arg_option): Add the qualifier
190 const into "longarg". Change the type of "shortarg" to int.
191
f806d18e 1922005-07-17 Yoshinori Okuji <okuji@enbug.org>
193
194 * boot/i386/pc/boot.S (boot_drive_check): New label.
195
196 * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_DRIVE_CHECK): New
197 macro.
198
199 * util/i386/pc/grub-setup.c (setup): Added a workaround for BIOSes
200 which do not pass a boot drive correctly. Copied from GRUB Legacy.
201
e293232b 2022005-07-17 Yoshinori Okuji <okuji@enbug.org>
203
204 * kern/i386/pc/startup.S (gate_a20_try_system_control_port_a):
205 When turning off Gate A20, skip the check and return immediately,
206 because this is not fatal usually.
207
ebedfd00 2082005-07-17 Yoshinori Okuji <okuji@enbug.org>
209
210 * conf/i386-pc.rmk (pxeboot_img_LDFLAGS): The text address should
211 be 0x7C00 instead of 0x8000.
212
213 * boot/i386/pc/pxeboot.S: Rewritten.
214
215 * kern/i386/pc/startup.S (gate_a20_try_bios): No need to specify
216 EXT_C.
217 (gate_a20_check_state): Read a byte from 0x108000. Invert the
218 result.
219
654fc59f 2202005-07-16 Yoshinori K. Okuji <okuji@enbug.org>
221
222 * kern/i386/pc/startup.S (grub_gate_a20): Rewritten for
223 robustness. This routine now supports a BIOS call and System
224 Control Port A to modify the gate A20.
225
226 * include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_RAW_SIZE):
227 Increased to 0x440.
228
09f9923f 2292005-07-12 Hollis Blanchard <hollis@penguinppc.org>
230
231 * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_open): dprintf the
232 device path and resulting ihandle.
233 (grub_ofdisk_close): dprintf the ihandle being closed.
234 (grub_ofdisk_read): dprintf function parameters.
235 * kern/mm.c (grub_mm_init_region): Likewise.
236 * loader/powerpc/ieee1275/linux.c: Remove extra whitespace.
237 (grub_linux_boot): dprintf the Linux entry point, initrd address and
238 size, and boot arguments.
239 (grub_rescue_cmd_linux): dprintf each ELF segment's address and size
240 before loading into memory.
241 (grub_rescue_cmd_initrd): dprintf the initrd's address and size
242 before loading into memory.
243
7ef504d8 2442005-07-12 Yoshinori K. Okuji <okuji@enbug.org>
245
246 * kern/mm.c: Added much documentation.
247 (GRUB_MM_ALIGN_LOG2): When GRUB_CPU_SIZEOF_VOID_P is
248 8, set to 5 instead of 8.
249
e0f050c2 2502005-07-10 Yoshinori Okuji <okuji@enbug.org>
251
252 * DISTLIST: Added util/i386/pc/grub-mkimage.c.
253
254 * conf/i386-pc.rmk (sbin_UTILITIES): Added grub-mkdevicemap.
255 (grub_mkdevicemap_SOURCES): New variable.
256
257 * util/i386/pc/grub-mkdevicemap.c: New file. Mostly copied from
258 lib/device.c of GRUB Legacy.
259
7224189a 2602005-07-10 Yoshinori Okuji <okuji@enbug.org>
261
262 * commands/ls.c (grub_ls_list_files): Check if *PATH is NUL
263 instead of PATH is NULL.
264
68c864eb 2652005-07-09 Vincent Pelletier <subdino2004@yahoo.fr>
266
267 * commands/cmp.c (BUFFER_SIZE): New macro.
268 (grub_cmd_cmp): Close the right file at the right time. Compare
269 only data just read. Don't report files of different size as
270 identical. Dynamically allocate buffers. Move variable
271 declarations at the beginning of function.
272
e6f3e614 2732005-07-09 Yoshinori Okuji <okuji@enbug.org>
274
275 * aclocal.m4 (grub_I386_CHECK_REGPARM_BUG): The return value was
276 reverse.
277
f8f1559a 2782004-07-04 Vincent Pelletier <subdino2004@yahoo.fr>
279
280 * normal/cmdline.c (grub_cmdline_get): Don't fallback on ctrl-d
281 when backspace is pressed at beginning of line.
282
39c9d41d 2832005-07-03 Yoshinori Okuji <okuji@enbug.org>
284
285 * DISTLIST: Added genfslist.sh.
286
287 * normal/main.c (fs_module_list): New variable.
288 (autoload_fs_module): New function.
289 (read_fs_list): Likewise.
290 (grub_normal_execute): Call read_fs_list.
291
292 * kern/fs.c (grub_fs_autoload_hook): New variable.
293 (grub_fs_probe): Added support for auto-loading.
294
295 * include/grub/normal.h (struct grub_fs_module_list): New struct.
296 (grub_fs_module_list_t): New type.
297
298 * include/grub/fs.h (grub_fs_autoload_hook_t): New type.
299 (grub_fs_autoload_hook): New prototype.
300
301 * genfslist.sh: New file.
302
303 * genmk.rb: Added a rule to generate a filesystem list.
304
121c1d83 3052005-06-30 Marco Gerards <metgerards@student.han.nl>
306
307 * configure.ac: Fix the test for cross-compiling.
308
309 * genmk.rb (Program): Use `$(CC)' instead of `$(BUILD_CC)'. Don't
310 define GRUB_UTIL anymore.
311
312 * util/powerpc/ieee1275/grub-mkimage.c (load_note): Endian fixes
313 so this function works on other systems than just big endian.
314 (load_modules): Likewise.
315 (add_segments): Likewise.
316
e75d76e1 3172005-06-23 Hollis Blanchard <hollis@penguinppc.org>
318
319 * kern/misc.c (grub_vsprintf): Add `longfmt'. If format string
320 contains `l' modifier, get a long from va_arg().
321
50b5a0a7 3222005-06-23 Yoshinori K. Okuji <okuji@enbug.org>
323
324 * kern/mm.c (grub_free): If the next free block which is being
325 merged is the first free block, set the first block to the block
326 being freed.
327 Reported by Vincent Guffens <guffens@inma.ucl.ac.be>.
328
89371b20 3292005-05-08 Hollis Blanchard <hollis@penguinppc.org>
330
331 * boot/powerpc/ieee1275/cmain.c (cmain): Initialize
332 `grub_ieee1275_chosen'.
333
168d6e58 3342005-05-08 Hollis Blanchard <hollis@penguinppc.org>
335
336 * boot/powerpc/ieee1275/cmain.c (module_info): Remove definition.
337 (grub_ieee1275_chosen): New variable.
338 (cmain): Initialize and use `grub_ieee1275_chosen' instead of
339 `chosen'.
340 * boot/powerpc/ieee1275/crt0.S (init_stack): Remove stack space.
341 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_get_property):
342 Rename first argument to `phandle' for consistency.
343 (grub_ieee1275_get_property_length): Likewise.
344 (grub_ieee1275_next_property): Likewise. Change type of first argument
345 to grub_ieee1275_phandle_t.
346 * include/grub/powerpc/ieee1275/ieee1275.h (grub_ieee1275_entry_fn):
347 Move export next to declaration.
348 (grub_ieee1275_chosen): New variable.
349 * include/grub/powerpc/ieee1275/kernel.h (GRUB_IEEE1275_MODULE_BASE):
350 Correct cosmetic typo.
351 * kern/powerpc/ieee1275/init.c (grub_set_prefix): Use
352 `grub_ieee1275_chosen'.
353 * kern/powerpc/ieee1275/openfw.c (grub_map): Likewise.
354 * loader/powerpc/ieee1275/linux.c (grub_linux_boot): Likewise.
355 (grub_rescue_cmd_linux): Set `initrd_addr' to 0.
356 * term/powerpc/ieee1275/ofconsole.c (grub_ofconsole_refresh): Use
357 `grub_ieee1275_chosen'.
358
ca5baa3f 3592005-05-10 Hollis Blanchard <hollis@penguinppc.org>
360
361 * boot/powerpc/ieee1275/cmain.c (cmain): Remove code to parse
362 /chosen/bootargs.
363 * kern/powerpc/ieee1275/init.c (grub_machine_init): Parse
364 /chosen/bootargs as "variable=value" pairs.
365
708b345f 3662005-05-08 Vincent Pelletier <subdino2004@yahoo.fr>
367
368 * include/grub/misc.h (grub_dprintf): New macro.
369 (grub_real_dprintf): New prototype.
370 (grub_strword): Likewise.
371 (grub_iswordseparator): Likewise.
372 * kern/misc.c (grub_real_dprintf): New function.
373 (grub_strword): Likewise.
374 (grub_iswordseparator): Likewise.
375
f4c5e67c 3762005-04-30 Hollis Blanchard <hollis@penguinppc.org>
377
378 * boot/powerpc/ieee1275/cmain.c: Don't include grub/machine/init.h.
379 (roundup): Remove macro.
380 (grub_ieee1275_flags): Make static.
381 (grub_ieee1275_realmode): Remove.
382 (grub_ieee1275_test_flag): New function.
383 (grub_ieee1275_set_flag): Likewise.
384 (find_options): Rename to `grub_ieee1275_find_options'; update
385 callers. Set GRUB_IEEE1275_FLAG_REAL_MODE and
386 GRUB_IEEE1275_FLAG_0_BASED_PARTITIONS.
387 (cmain): New prototype.
388 (cmain): Use `grub_ieee1275_set_flag' instead of accessing
389 `grub_ieee1275_flags' directly.
390 * conf/powerpc-ieee1275.rmk (grubof_HEADERS): Remove
391 machine/biosdisk.h.
392 * disk/powerpc/ieee1275/ofdisk.c: Include grub/machine/ofdisk.h.
393 Don't include grub/machine/init.h.
394 (grub_ofdisk_open): Call `grub_ieee1275_test_flag'.
395 * include/grub/powerpc/ieee1275/ieee1275.h (grub_ieee1275_flags):
396 Remove prototype.
397 (grub_ieee1275_realmode): Likewise.
398 (grub_ieee1275_flag): New enum.
399 (grub_ieee1275_test_flag): New prototype.
400 (grub_ieee1275_set_flag): New prototype.
401 * include/grub/powerpc/ieee1275/init.h: Remove file.
402 * include/grub/powerpc/ieee1275/ofdisk.h: New file.
403 * kern/powerpc/ieee1275/init.c: Don't include grub/machine/init.h.
404 Include grub/machine/console.h. Include grub/machine/ofdisk.h.
405 (grub_machine_fini): Don't call `grub_ieee1275_release'. Remove
406 comment.
407 * kern/powerpc/ieee1275/openfw.c (grub_claimmap): Call
408 `grub_ieee1275_test_flag'.
409 (grub_ieee1275_encode_devname): Likewise.
410
ed16607e 4112005-04-21 Hollis Blanchard <hollis@penguinppc.org>
412
413 * include/grub/powerpc/ieee1275/ieee1275.h
414 (grub_ieee1275_encode_devname): New prototype.
415 (grub_ieee1275_get_filename): Likewise.
416 * kern/powerpc/ieee1275/init.c (grub_translate_ieee175_path): New
417 function.
418 (grub_set_prefix): Likewise.
419 (grub_machine_init): Call grub_set_prefix.
420 * kern/powerpc/ieee1275/openfw.c: Fix typos.
421 (grub_parse_type): New enum.
422 (grub_ieee1275_get_devargs): New function.
423 (grub_ieee1275_get_devname): Likewise.
424 (grub_ieee1275_parse_args): Likewise.
425 (grub_ieee1275_get_filename): Likewise.
426 (grub_ieee1275_encode_devname): Likewise.
427
be369920 4282005-03-30 Marco Gerards <metgerards@student.han.nl>
429
430 * kern/powerpc/ieee1275/init.c (grub_machine_fini): Don't call
431 `grub_loader_unset'.
432
a5ce3a4a 4332005-03-26 Hollis Blanchard <hollis@penguinppc.org>
434
435 * commands/ieee1275/halt.c (grub_cmd_halt): Call grub_halt
436 instead of grub_ieee1275_interpret.
437 (grub_halt_init): New function.
438 (grub_halt_fini): Likewise.
439 (GRUB_MOD_INIT): Correct message grammar.
440 * commands/ieee1275/reboot.c (grub_cmd_reboot): Call grub_reboot
441 instead of grub_ieee1275_interpret.
442 (grub_reboot_init): New function.
443 (grub_reboot_fini): Likewise.
444 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Replace
445 commands/i386/pc/halt.c, commands/i386/pc/reboot.c, and
446 util/i386/pc/misc.c with commands/ieee1275/halt.c,
447 commands/ieee1275/reboot.c, and util/powerpc/ieee1275/misc.c.
448 * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_fini): New
449 function.
450 * include/grub/powerpc/ieee1275/console.h (grub_console_fini):
451 Add prototype.
452 * include/grub/powerpc/ieee1275/ieee1275.h (grub_reboot): Add
453 prototype.
454 (grub_halt): Likewise.
455 * include/grub/powerpc/ieee1275/init.h: Remove inaccurate comment.
456 (cmain): Remove __attribute__((unused)).
457 * kern/powerpc/ieee1275/init.c (grub_heap_start): New variable.
458 (grub_heap_len): Likewise.
459 (grub_machine_fini): New function.
460 * kern/powerpc/ieee1275/openfw.c (grub_reboot): New function.
461 (grub_halt): Likewise.
462 * term/powerpc/ieee1275/ofconsole.c (grub_console_fini): New
463 function.
464 * util/powerpc/ieee1275/misc.c: New file.
465
0058f771 4662005-03-19 Yoshinori K. Okuji <okuji@enbug.org>
467
468 * DISTLIST: New file.
469 * gendistlist.sh: Likewise.
470
471 * Makefile.in (COMMON_DISTFILES): Removed.
472 (BOOT_DISTFILES): Likewise.
473 (CONF_DISTFILES): Likewise.
474 (DISK_DISTFILES): Likewise.
475 (FS_DISTFILES): Likewise.
476 (INCLUDE_DISTFILES): Likewise.
477 (KERN_DISTFILES): Likewise.
478 (LOADER_DISTFILES): Likewise.
479 (TERM_DISTFILES): Likewise.
480 (UTIL_DISTFILES): Likewise.
481 (DISTFILES): Likewise.
482 (uninstall): Uninstall files in $(pkgdata_DATA).
483 (DISTLIST): New target.
484 (distdir): Use the contents of the file DISTLIST to get a list of
485 distributed files.
486
46b3b8a5 4872005-03-18 Yoshinori K. Okuji <okuji@enbug.org>
488
489 * fs/fat.c (grub_fat_mount): Ignore the 3rd bit of a media
490 descriptor. This is ported from GRUB Legacy.
491
492 * gencmdlist.sh: Added an extra semicolon to make it work with
493 old sed versions. Reported by Robert Bihlmeyer
494 <robbe@orcus.priv.at>.
495
5822ff87 4962005-03-08 Yoshinori Okuji <okuji@enbug.org>
497
498 Automatic loading of commands is supported.
499
500 * normal/main.c (read_command_list): New function.
501 (grub_normal_execute): Call read_command_list.
502
503 * normal/command.c (grub_register_command): Return zero or CMD.
504 Allocate CMD->NAME from the heap.
505 Initialize CMD->MODULE_NAME to zero.
506 Find the same name as well. If the same command is found and it is
507 a dummy command, overwrite members. If it is not a dummy command,
508 return zero.
509 (grub_unregister_command): Free Q->NAME and Q->MODULE_NAME.
510 (grub_command_find): If a dummy command is found, load a module
511 and retry to find a command only once.
512
513 * normal/cmdline.c (grub_tab_complete): Call grub_command_find to
514 make sure that each command is loaded.
515
516 * include/grub/normal.h (GRUB_COMMAND_FLAG_NOT_LOADED): New
517 macro.
518 (struct grub_command): Remove const from the member `name'.
519 Add a new member `module_name'.
520 (grub_register_command): Return grub_command_t.
521
522 * commands/help.c (grub_cmd_help): Call grub_command_find to make
523 sure that each command is loaded.
524
525 * genmk.rb (PModule::rule): Specify a module name without the
526 suffix ".mod" to gencmdlist.sh.
527
7b1f4b57 5282005-03-02 Yoshinori K. Okuji <okuji@enbug.org>
529
530 * gencmdlist.sh: New file.
531
532 * genmk.rb (PModule::rule): Generate a rule for a command list.
533 Clean command.lst.
534 Generate command.lst from $(COMMANDFILES).
535
536 * Makefile.in (COMMON_DISTFILES): Added gencmdlist.sh.
537 (DATA): Added $(pkgdata_DATA).
538 (install-local): Install files in $(pkgdata_DATA).
539
062aaf39 5402005-03-02 Yoshinori K. Okuji <okuji@enbug.org>
541
542 * term/i386/pc/vga.c (debug_command): Removed.
543 (GRUB_MOD_INIT): Do not register the command "debug".
544
545 From Hollis Blanchard:
546 * commands/configfile.c: New file.
547 * conf/i386-pc.rmk (grub_emu_SOURCES): Added
548 commands/configfile.c.
549 (pkgdata_MODULES): Added configfile.mod.
550 (configfile_mod_SOURCES): New variable.
551 (configfile_mod_CFLAGS): Likewise.
552 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Added
553 commands/configfile.c.
554 (pkgdata_MODULES): Added configfile.mod.
555 (configfile_mod_SOURCES): New variable.
556 (configfile_mod_CFLAGS): Likewise.
557 * util/grub-emu.c (main): Call grub_configfile_init and
558 grub_configfile_fini.
559 * include/grub/normal.h [GRUB_UTIL] (grub_configfile_init): New
560 prototype.
561 [GRUB_UTIL] (grub_configfile_fini): Likewise.
562
cee01aa6 5632005-02-27 Yoshinori K. Okuji <okuji@enbug.org>
564
565 * normal/arg.c (grub_arg_show_help): Do not show the bug report
566 address.
567
568 * commands/help.c (grub_cmd_help): Do not print newlines after
569 the last command in print_command_help.
570
93f3a1d8 5712005-02-27 Yoshinori K. Okuji <okuji@enbug.org>
572
573 * commands/default.h: New file.
574 * commands/timeout.h: Likewise.
575 * normal/context.c: Likewise.
576
577 * util/misc.c: Do not include sys/times.h.
578 Include sys/time.h and grub/machine/time.h.
579 (grub_get_rtc): Rewritten with gettimeofday.
580
581 * util/grub-emu.c (main): Call grub_default_init and
582 grub_timeout_init before grub_normal_init, and call
583 grub_timeout_fini and grub_default_fini after grub_main.
584
585 * util/console.c (grub_ncurses_checkkey): Return the read
586 character or -1.
587
588 * normal/menu.c (run_menu): Set MENU->TIMEOUT to -1 once it
589 timeouts.
590
591 * normal/main.c (read_config_file): Push MENU. If this fails,
592 print an error and wait for a user input.
593 Print an error only if GRUB_ERRNO is not GRUB_ERR_NONE.
594 If a menu is empty or an error occurs, pop MENU.
595 (grub_normal_execute): Pop and free MENU after grub_menu_run
596 returns.
597
598 * kern/loader.c (grub_loader_boot): Call grub_machine_fini.
599
600 * include/grub/powerpc/ieee1275/time.h [GRUB_UTIL]: Do not
601 include time.h.
602 [GRUB_UTIL] (GRUB_TICKS_PER_SECOND): Use the same definition as
603 without GRUB_UTIL.
604 * include/grub/i386/pc/time.h [GRUB_UTIL]: Do not include
605 time.h.
606 [GRUB_UTIL] (GRUB_TICKS_PER_SECOND): Use the same definition as
607 without GRUB_UTIL.
608
609 * include/grub/normal.h (struct grub_menu_list): New struct.
610 (grub_menu_list_t): New type.
611 (struct grub_context): New struct.
612 (grub_context_t): New type.
613 (grub_register_command): Got rid of EXPORT_FUNC.
614 (grub_unregister_command): Likewise.
615 (grub_context_get): New prototype.
616 (grub_context_get_current_menu): Likewise.
617 (grub_context_push_menu): Likewise.
618 (grub_context_pop_menu): Likewise.
619 [GRUB_UTIL] (grub_default_init): Likewise.
620 [GRUB_UTIL] (grub_default_fini): Likewise.
621 [GRUB_UTIL] (grub_timeout_init): Likewise.
622 [GRUB_UTIL] (grub_timeout_fini): Likewise.
623
624 * conf/i386-pc.rmk (grub_emu_SOURCES): Added commands/default.c,
625 commands/timeout.c and normal/context.c.
626 (pkgdata_MODULES): Added default.mod and timeout.mod.
627 (normal_mod_SOURCES): Added normal/context.c.
628 (default_mod_SOURCES): New variable.
629 (default_mod_CFLAGS): Likewise.
630 (timeout_mod_SOURCES): Likewise.
631 (timeout_mod_CFLAGS): Likewise.
632 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Copied from
633 conf/i386-pc.rmk.
634 (pkgdata_MODULES): Added default.mod and timeout.mod.
635 (normal_mod_SOURCES): Added normal/context.c.
636 (default_mod_SOURCES): New variable.
637 (default_mod_CFLAGS): Likewise.
638 (timeout_mod_SOURCES): Likewise.
639 (timeout_mod_CFLAGS): Likewise.
640
641 * Makefile.in (all-local): Added $(MKFILES).
642
4ed2e1dd 6432005-02-21 Vincent Pelletier <subdino2004@yahoo.fr>
644
645 * conf/i386-pc.rmk (grub_setup_SOURCES): Add `partmap/sun.c'.
646 (grub_emu_SOURCES): Likewise.
647 (pkgdata_MODULES): Add `sun.mod'.
648 (sun_mod_SOURCES, sun_mod_CFLAGS): New variables.
649 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add
650 `partmap/sun.c'.
651 (pkgdata_MODULES): Add `sun.mod'.
652 (sun_mod_SOURCES, sun_mod_CFLAGS): New variables.
653 * include/grub/partition.h (grub_sun_partition_map_init): New
654 prototype.
655 (grub_sun_partition_map_fini): Likewise.
656 * partmap/sun.c: New file.
657 * util/grub-emu.c (main): Initialize and de-initialize the sun
658 partitionmap support.
659
4d4e372e 6602005-02-19 Yoshinori K. Okuji <okuji@enbug.org>
661
662 This implements an Emacs-like menu entry editor.
663
664 * normal/menu_entry.c: New file.
665
666 * util/console.c (grub_ncurses_putchar): Translate some Unicode
667 characters to ASCII.
668 (saved_char): New variable.
669 (grub_ncurses_checkkey): Rewritten completely.
670 (grub_ncurses_getkey): Likewise.
671 (grub_ncurses_init): Call raw instead of cbreak.
672
673 * normal/menu.c (print_entry): Do not put a space.
674 (init_page): Renamed to ...
675 (grub_menu_init_page): ... this. All callers changed.
676 (edit_menu_entry): Removed.
677 (run_menu): Call grub_menu_entry_run instead of edit_menu_entry.
678
679 * normal/cmdline.c (grub_cmdline_run): Call grub_setcursor.
680
681 * kern/misc.c (grub_vprintf): Call grub_refresh.
682
683 * normal/menu.c (DISP_LEFT): Renamed to ...
684 * include/grub/term.h (GRUB_TERM_DISP_LEFT): ... this.
685 * normal/menu.c (DISP_UP): Renamed to ...
686 * include/grub/term.h (GRUB_TERM_DISP_UP): ... this.
687 * normal/menu.c (DISP_RIGHT): Renamed to ...
688 * include/grub/term.h (GRUB_TERM_DISP_RIGHT): ... this.
689 * normal/menu.c (DISP_DOWN): Renamed to ...
690 * include/grub/term.h (GRUB_TERM_DISP_DOWN): ... this.
691 * normal/menu.c (DISP_HLINE): Renamed to ...
692 * include/grub/term.h (GRUB_TERM_DISP_HLINE): ... this.
693 * normal/menu.c (DISP_VLINE): Renamed to ...
694 * include/grub/term.h (GRUB_TERM_DISP_VLINE): ... this.
695 * normal/menu.c (DISP_UL): Renamed to ...
696 * include/grub/term.h (GRUB_TERM_DISP_UL): ... this.
697 * normal/menu.c (DISP_UR): Renamed to ...
698 * include/grub/term.h (GRUB_TERM_DISP_UR): ... this.
699 * normal/menu.c (DISP_LL): Renamed to ...
700 * include/grub/term.h (GRUB_TERM_DISP_LL): ... this.
701 * normal/menu.c (DISP_LR): Renamed to ...
702 * include/grub/term.h (GRUB_TERM_DISP_LR): ... this.
703 * normal/menu.c (TERM_WIDTH): Renamed to ...
704 * include/grub/term.h (GRUB_TERM_WIDTH): ... this.
705 * normal/menu.c (TERM_HEIGHT): Renamed to ...
706 * include/grub/term.h (GRUB_TERM_HEIGHT): ... this.
707 * normal/menu.c (TERM_INFO_HEIGHT): Renamed to ...
708 * include/grub/term.h (GRUB_TERM_INFO_HEIGHT): ... this.
709 * normal/menu.c (TERM_MARGIN): Renamed to ...
710 * include/grub/term.h (GRUB_TERM_MARGIN): ... this.
711 * normal/menu.c (TERM_SCROLL_WIDTH): Renamed to ...
712 * include/grub/term.h (GRUB_TERM_SCROLL_WIDTH): ... this.
713 * normal/menu.c (TERM_TOP_BORDER_Y): Renamed to ...
714 * include/grub/term.h (GRUB_TERM_TOP_BORDER_Y): ... this.
715 * normal/menu.c (TERM_LEFT_BORDER_X): Renamed to ...
716 * include/grub/term.h (GRUB_TERM_LEFT_BORDER_X): ... this.
717 * normal/menu.c (TERM_BORDER_WIDTH): Renamed to ...
718 * include/grub/term.h (GRUB_TERM_BORDER_WIDTH): ... this.
719 * normal/menu.c (TERM_MESSAGE_HEIGHT): Renamed to ...
720 * include/grub/term.h (GRUB_TERM_MESSAGE_HEIGHT): ... this.
721 * normal/menu.c (TERM_BORDER_HEIGHT): Renamed to ...
722 * include/grub/term.h (GRUB_TERM_BORDER_HEIGHT): ... this.
723 * normal/menu.c (TERM_NUM_ENTRIES): Renamed to ...
724 * include/grub/term.h (GRUB_TERM_NUM_ENTRIES): ... this.
725 * normal/menu.c (TERM_FIRST_ENTRY_Y): Renamed to ...
726 * include/grub/term.h (GRUB_TERM_FIRST_ENTRY_Y): ... this.
727 * normal/menu.c (TERM_ENTRY_WIDTH): Renamed to ...
728 * include/grub/term.h (GRUB_TERM_ENTRY_WIDTH): ... this.
729 * normal/menu.c (TERM_CURSOR_X): Renamed to ...
730 * include/grub/term.h (GRUB_TERM_CURSOR_X): ... this.
731 All callers changed.
732
733 * include/grub/normal.h: New prototype.
734
735 * conf/i386-pc.rmk (grub_emu_SOURCES): Added
736 normal/menu_entry.c.
737 (normal_mod_SOURCES): Likewise.
738 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise.
739 (normal_mod_SOURCES): Likewise.
740
e6b92c8a 7412005-02-15 Yoshinori K. Okuji <okuji@enbug.org>
742
743 * include/grub/normal.h (grub_halt_init): New prototype.
744 (grub_halt_fini): Likewise.
745 (grub_reboot_init): Likewise.
746 (grub_reboot_fini): Likewise.
747
748 * util/grub-emu.c: Include signal.h.
749 (main_env): New global variable.
750 (grub_machine_init): Ignore SIGINT. Otherwise grub-emu cannot
751 catch C-c.
752 (grub_machine_fini): New function.
753 (main): Call grub_halt_init and grub_reboot_init before
754 grub_main, and grub_reboot_fini and grub_halt_fini after it.
755 Call setjmp with MAIN_ENV to go back afterwards.
756 Call grub_machine_fini right before return.
757
758 * include/grub/util/misc.h: Include setjmp.h.
759 (main_env): New prototype.
760
761 * include/grub/kernel.h (grub_machine_fini): New prototype.
762 * include/grub/i386/pc/biosdisk.h (grub_biosdisk_fini): Likewise.
763 * include/grub/i386/pc/console.h (grub_console_fini): Likewise.
764
765 * disk/i386/pc/biosdisk.c (grub_biosdisk_fini): New function.
766 * kern/i386/pc/init.c (grub_machine_fini): Likewise.
767 * term/i386/pc/console.c (grub_console_fini): Likewise.
768
769 * util/i386/pc/misc.c: New file.
770
771 * conf/i386-pc.rmk (grub_emu_SOURCES): Added
772 util/i386/pc/misc.c, commands/i386/pc/halt.c and
773 commands/i386/pc/reboot.c.
774
c642636f 7752005-02-14 Guillem Jover <guillem@hadrons.org>
776
777 * include/grub/dl.h (grub_dl_check_header): New prototype.
778 (grub_arch_dl_check_header): Change return type to grub_err_t,
779 remove size parameter and export function. Update all callers.
780 * kern/dl.c (grub_dl_check_header): New function.
781 (grub_dl_load_core): Use `grub_dl_check_header' instead of
782 `grub_arch_dl_check_header'. Check ELF type. Check if sections
783 are inside the core.
784 * kern/i386/dl.c (grub_arch_dl_check_header): Remove arch
785 independent ELF header checks.
786 * kern/powerpc/dl.c (grub_arch_dl_check_header): Likewise.
787 * loader/i386/pc/multiboot.c (grub_rescue_cmd_multiboot): Use
788 `grub_dl_check_header' instead of explicit checks. Check for the
789 ELF type.
790 * loader/powerpc/ieee1275/linux.c (grub_rescue_cmd_linux): Use
791 `grub_dl_check_header' instead of explicit checks. Remove arch
792 specific ELF header checks.
793
e6b92c8a 794 * util/grub-emu.c (grub_arch_dl_check_header): Remove the
795 argument SIZE.
796
5eabe94b 7972005-02-13 Hollis Blanchard <hollis@penguinppc.org>
798
799 * conf/powerpc-ieee1275.rmk (pkgdata_MODULES): Add ls.mod.
800 * include/grub/powerpc/libgcc.h (__mulsf3): New prototype.
801
1b14a681 8022005-02-12 Hollis Blanchard <hollis@penguinppc.org>
803
804 * kern/partition.c (grub_partition_probe): Clear `grub_errno' and
805 return 0 if `grub_errno' is GRUB_ERR_BAD_PART_TABLE.
806 (part_map_iterate): Clear `grub_errno' and return 0 if
807 `partmap->iterate' returns GRUB_ERR_BAD_PART_TABLE.
808 * partmap/amiga.c (amiga_partition_map_iterate): Return
809 GRUB_ERR_BAD_PART_TABLE if no partition map magic is found.
810 * partmap/apple.c (apple_partition_map_iterate): Likewise.
811
aca108aa 8122005-02-01 Guillem Jover <guillem@hadrons.org>
813
814 * loader/i386/pc/multiboot_normal.c (GRUB_MOD_INIT): Fix module
815 help info.
816
c9f9c556 8172005-01-31 Marco Gerards <metgerards@student.han.nl>
818
819 * include/grub/powerpc/ieee1275/loader.h (grub_load_linux):
820 Removed prototype.
821 (grub_rescue_cmd_linux): New prototype.
822 (grub_rescue_cmd_initrd): Likewise.
823 * powerpc/ieee1275/linux.c (grub_linux_boot): Remove struct
824 `bi_rec'.
825 (grub_linux_release_mem): Release the memory for the initrd.
826 (grub_load_linux): Renamed from this...
827 (grub_rescue_cmd_linux): ...To this. Changed all callers.
828 Changed `entry' not to be static. Loop over memory regions to
829 find another one when the default fails.
830 (grub_rescue_cmd_initrd): New function.
831 (grub_linux_init): Remove function.
832 (grub_linux_fini): Likewise.
833 (GRUB_MOD_INIT): Register `initrd'.
834 (GRUB_MOD_FINI): Unregister `initrd'.
835 * powerpc/ieee1275/linux_normal.c (grub_linux_normal_init):
836 Function removed.
837 (grub_linux_normal_fini): Likewise.
838 (GRUB_MOD_INIT): Register `initrd'.
839 (GRUB_MOD_FINI): Unregister `initrd'.
840
990cf3aa 8412005-01-31 Marco Gerards <metgerards@student.han.nl>
842
843 * commands/help.c: New file.
844 * normal/arg.c (show_help): Renamed to...
845 (grub_arg_show_help): ... this.
846 * commands/i386/pc/halt.c: New file.
847 * commands/i386/pc/reboot.c: Likewise.
848 * conf/i386-pc.rmk (grub_emu_SOURCES): Add `commands/help.c'.
849 (pkgdata_MODULES): Add `reboot.mod', `halt.mod' and `help.mod'.
850 (help_mod_SOURCES, help_mod_CFLAGS, reboot_mod_SOURCES)
851 (reboot_mod_CFLAGS, halt_mod_SOURCES, halt_mod_CFLAGS): New
852 variables.
853 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add
854 `commands/help.c'.
855 (pkgdata_MODULES): Add `help.mod'.
856 (help_mod_SOURCES, help_mod_CFLAGS): New variables.
857 * grub/i386/pc/init.h (grub_reboot): New prototype.
858 (grub_halt): Likewise.
859 * include/grub/normal.h (grub_arg_show_help): New prototype.
860 (grub_help_init): Likewise.
861 (grub_help_fini): Likewise.
862 * util/grub-emu.c (main): Initialize and deinitialize the help
863 command.
864
865 * normal/cmdline.c (grub_cmdline_get): Doc fix.
866
867 * normal/command.c (grub_command_init): Fixed the description of
868 the `set' and `unset' commands.
869
8702005-01-31 Marco Gerards <metgerards@student.han.nl>
0f79cdc1 871
872 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_interpret): New
873 function.
874 * commands/ieee1275/halt.c: New file.
875 * commands/ieee1275/reboot.c: Likewise.
876 * commands/ieee1275/suspend.c (grub_cmd_suspend): Use
877 `__attribute__ ((unused))'. Some GCS related fixed.
878 (grub_suspend_init) [GRUB_UTIL]: Function removed.
879 (grub_suspend_fini): Likewise.
880 * conf/powerpc-ieee1275.rmk (pkgdata_MODULES): Add `reboot.mod'
881 and `halt.mod'.
882 (reboot_mod_SOURCES, reboot_mod_CFLAGS, halt_mod_SOURCES)
883 (halt_mod_CFLAGS): New variables.
884 * include/grub/powerpc/ieee1275/ieee1275.h
885 (grub_ieee1275_interpret): New prototype.
886
1ab09cc7 8872005-01-29 Yoshinori K. Okuji <okuji@enbug.org>
888
889 * include/grub/misc.h (memmove): New prototype.
890 (memcpy): Likewise.
891
8b8cbdb2 8922005-01-22 Hollis Blanchard <hollis@penguinppc.org>
893
894 * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_open): Don't initialize
895 `devpath' to 0. Use `name' instead of `devpath' with `grub_strndup'.
896
e3741a27 8972005-01-22 Marco Gerards <metgerards@student.han.nl>
898
899 * kern/misc.c (grub_strndup): Function rewritten.
900
776bd780 9012005-01-22 Vincent Pelletier <subdino2004@yahoo.fr>
902
903 * normal/menu.c (TERM_WIDTH): Macro redefined.
904 (TERM_TOP_BORDER_Y): Likewise.
905 (draw_border): Replaced while-loop by a for-loop. Make the number
906 of lines consistent with the number of lines displayed in
907 print_entries. Added a margin below the rectangle.
908 (print_entry): Make the entry fit in the rectangle.
909 (print_entries): Display the scroll arrows next to the right
910 border.
911
78026bce 9122005-01-21 Marco Gerards <metgerards@student.han.nl>
913
914 * fs/minix.c (grub_minix_find_file): Reserve more space for
915 `fpath' so the \0 can be stored. Use `grub_strcpy' instead of
916 `grub_strncpy' to copy `path' into it.
917
67bbaf0f 9182005-01-21 Marco Gerards <metgerards@student.han.nl>
919
920 Add the loopback device, a device via which files can be accessed
921 as devices.
922
923 * conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/loopback.c'.
924 (pkgdata_MODULES): Add loopback.mod.
925 (loopback_mod_SOURCES): New variable.
926 (loopback_mod_CFLAGS): Likewise.
927 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add
928 `disk/loopback.c'.
929 (pkgdata_MODULES): Add loopback.mod.
930 (loopback_mod_SOURCES): New variable.
931 (loopback_mod_CFLAGS): Likewise.
932 * disk/loopback.c: new file.
933 * include/grub/normal.h (grub_loop_init): New prototype.
934 (grub_loop_fini): New prototype.
935 * util/grub-emu.c (main): Initialize and de-initialize loopback
936 support.
937 * include/grub/disk.h (grub_disk_dev_id): Add
938 `GRUB_DISK_DEVICE_LOOPBACK_ID'.
939
6f1c18bd 9402005-01-20 Hollis Blanchard <hollis@penguinppc.org>
941
942 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_enter): New
943 function.
944 * conf/powerpc-ieee1275.rmk (pkgdata_MODULES): Add suspend.mod.
945 (suspend_mod_SOURCES): New variable.
946 (suspend_mod_CFLAGS): Likewise.
947 * include/grub/powerpc/ieee1275/ieee1275.h (grub_ieee1275_enter):
948 New prototype.
949 * commands/ieee1275/suspend.c: New file.
950
b38551da 9512005-01-20 Timothy Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
952
953 * include/grub/dl.h (GRUB_MOD_INIT): Changed `__attribute__
954 ((unused))' to `__attribute__ ((used))'.
955 (GRUB_MOD_FINI): Likewise.
956 * kern/dl.c (grub_dl_load_file): Fix null pointer dereference.
957 * genmk.rb (PModule): Assign space to common symbols when linking
958 modules.
959
777aff39 9602005-01-20 Marco Gerards <metgerards@student.han.nl>
961
962 * include/grub/mm.h (grub_mm_init_region): Change the type of the
963 `unsigned' arguments to `grub_size_t'.
964 (grub_malloc): Likewise.
965 (grub_realloc): Likewise.
966 (grub_memalign): Likewise.
967 * kern/i386/dl.c (grub_arch_dl_check_header): Likewise.
968 * kern/powerpc/dl.c (grub_arch_dl_check_header): Likewise.
969 * util/misc.c (grub_malloc): Likewise.
970 (grub_realloc): Likewise.
971 * kern/mm.c (get_header_from_pointer): Change the casts to
972 `unsigned' into a cast to `grub_size_t'.
973
974 * fs/fshelp.c (grub_fshelp_find_file): The `oldnode' should always
975 point to `currnode' when `currnode' is changed.
976
977 * util/grub-emu.c (main): Initialize `progname'. Reported by Nico
978 Schottelius <nico-linux@schottelius.org>.
979
d0ff18e1 9802005-01-09 Hollis Blanchard <hollis@penguinppc.org>
981
982 * util/powerpc/ieee1275/grub-mkimage.c: Include <string.h>.
983 (note_path): Remove variable.
984 (GRUB_IEEE1275_NOTE_NAME): New macro.
985 (GRUB_IEEE1275_NOTE_TYPE): Likewise.
986 (grub_ieee1275_note_hdr): New structure.
987 (grub_ieee1275_note_desc): Likewise.
988 (grub_ieee1275_note): Likewise.
989 (load_note): Remove `dir' argument. All callers updated. Remove
990 `note_img' and `path'. Do not load a file from `note_path'.
991 Initialize a struct grub_ieee1275_note and write that to `out'.
992 Use GRUB_IEEE1275_MODULE_BASE instead of MODULE_BASE.
993
4ca7004c 9942005-01-05 Marco Gerards <metgerards@student.han.nl>
995
996 * util/misc.c (grub_util_read_image): Revert last change. It
997 called `grub_util_read_at', which seeks from the beginning of the
998 file.
999
0b412211 10002005-01-04 Hollis Blanchard <hollis@penguinppc.org>
1001
1002 * TODO: Add note about endianness in grub-mkimage.
1003 * boot/powerpc/ieee1275/crt0.S (note): Remove unused .note
1004 section.
1005 * conf/powerpc-ieee1275.rmk (bin_UTILITIES): Add grub-mkimage.
1006 (grub_mkimage_SOURCES): New target.
1007 * include/grub/kernel.h (grub_start_addr): Remove variable.
1008 (grub_end_addr): Likewise.
1009 (grub_total_module_size): Likewise.
1010 (grub_kernel_image_size): Likewise.
1011 (GRUB_MODULE_MAGIC): New constant.
1012 (grub_module_info): New structure.
1013 (grub_arch_modules_addr): New prototype.
1014 (grub_get_end_addr): Remove prototype.
1015 * include/grub/i386/pc/kernel.h (grub_end_addr): New prototype.
1016 * include/grub/powerpc/ieee1275/kernel.h: New file.
1017 * include/grub/util/misc.h (grub_util_get_fp_size): New
1018 prototype.
1019 (grub_util_read_at): Likewise.
1020 (grub_util_write_image_at): Likewise.
1021 * kern/main.c (grub_get_end_addr): Remove function.
1022 (grub_load_modules): Call grub_arch_modules_addr instead of using
1023 grub_end_addr. Look for a grub_module_info struct in memory. Use
1024 the grub_module_info fields instead of calling grub_get_end_addr
1025 as loop conditions. Move grub_add_unused_region code here.
1026 (grub_add_unused_region): Remove function.
1027 * kern/i386/pc/init.c: Include grub/cache.h.
1028 (grub_machine_init): Remove call to grub_get_end_addr. Remove
1029 one call to add_mem_region.
1030 (grub_arch_modules_addr): New function.
1031 * kern/powerpc/ieee1275/init.c (grub_end_addr): Remove variable.
1032 (grub_total_module_size): Likewise.
1033 Include grub/machine/kernel.h.
1034 (grub_arch_modules_addr): New function.
1035 * util/grub-emu.c (grub_end_addr): Remove variable.
1036 (grub_total_module_size): Likewise.
1037 (grub_arch_modules_addr): New function.
1038 * util/misc.c: Include unistd.h.
1039 (grub_util_get_fp_size): New function.
1040 (grub_util_read_at): Likewise.
1041 (grub_util_write_image_at): Likewise.
1042 (grub_util_read_image): Call grub_util_read_at.
1043 (grub_util_write_image): Call grub_util_write_image_at.
1044 * util/i386/pc/grub-mkimage.c (generate_image): Allocate
1045 additional memory in kernel_img for a struct grub_module_info.
1046 Fill in that grub_module_info.
1047 * util/powerpc/ieee1275/grub-mkimage.c: New file.
1048
458786f8 10492005-01-03 Hollis Blanchard <hollis@penguinppc.org>
1050
1051 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_milliseconds):
1052 New function.
1053 * include/grub/powerpc/ieee1275/ieee1275.h
1054 (grub_ieee1275_milliseconds): New prototype.
1055 * include/grub/powerpc/ieee1275/time.h (GRUB_TICKS_PER_SECOND):
1056 Change to 1000.
1057 * kern/powerpc/ieee1275/init.c (grub_get_rtc): Call
1058 grub_ieee1275_milliseconds.
1059
ac507d1b 10602005-01-03 Hollis Blanchard <hollis@penguinppc.org>
1061
1062 * boot/powerpc/ieee1275/cmain.c (grub_ieee1275_realmode): New
1063 variable.
1064 (find_options): New function.
1065 (cmain): Call find_options.
1066 * include/grub/powerpc/ieee1275/ieee1275.h
1067 (grub_ieee1275_realmode): New extern variable.
1068 * kern/powerpc/ieee1275/openfw.c (grub_claimmap): Only call
1069 grub_map if grub_ieee1275_realmode is false.
1070
6b8fd1c4 10712004-12-29 Marco Gerards <metgerards@student.han.nl>
1072
1073 * normal/cmdline.c (grub_cmdline_get): Redone logic so no empty
1074 lines are inserted and make it work like readline. Reported by
1075 Vincent Pelletier <subdino2004@yahoo.fr>.
1076
8514a1e0 10772004-12-28 Marco Gerards <metgerards@student.han.nl>
1078
1079 * boot/powerpc/ieee1275/crt0.S (_start): Don't set up the stack.
1080
1081 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCE): Remove
1082 `kern/powerpc/cache.S'.
1083
924b6140 10842004-12-27 Marco Gerards <metgerards@student.han.nl>
1085
1086 * genmk.rb: Handle the `Program' class in the main loop. Written
1087 by Johan Rydberg <jrydberg@gnu.org>.
1088 (Program): New class.
1089 (programs): New variable.
1090 * boot/powerpc/ieee1275/cmain.c: Include <grub/machine/ieee1275.h>
1091 instead of "grub/machine/ieee1275.h". Include <grub/kernel.h>
1092 instead of "grub/kernel.h". Include <grub/machine/init.h>.
1093 (help_arch): Function removed.
1094 * conf/powerpc-ieee1275.rmk (grubof_HEADERS): Add
1095 `powerpc/libgcc.h' and `loader.h'.
1096 (pkgdata_PROGRAMS): New variable.
1097 (sbin_UTILITIES): Variable removed.
1098 (grub_emu_SOURCES): Added kern/powerpc/cache.S.
1099 (grubof_SOURCES): Variable re-defined so it only includes the
1100 core functionality.
1101 (grubof_CFLAGS): Remove `-DGRUBOF'.
1102 (pkgdata_MODULES, fshelp_mod_SOURCES, fshelp_mod_CFLAGS,
1103 (fat_mod_SOURCES, fat_mod_CFLAGS, ext2_mod_SOURCES)
1104 (ext2_mod_CFLAGS, ufs_mod_SOURCES, ufs_mod_CFLAGS)
1105 (minix_mod_SOURCES, minix_mod_CFLAGS, hfs_mod_SOURCES)
1106 (hfs_mod_CFLAGS, jfs_mod_SOURCES, jfs_mod_CFLAGS)
1107 (iso9660_mod_SOURCES, iso9660_mod_CFLAGS, _linux_mod_SOURCES)
1108 (_linux_mod_CFLAGS, linux_mod_SOURCES, linux_mod_CFLAGS)
1109 (normal_mod_SOURCES, normal_mod_CFLAGS, normal_mod_ASFLAGS)
1110 (hello_mod_SOURCES, hello_mod_CFLAGS, boot_mod_SOURCES)
1111 (boot_mod_CFLAGS, terminal_mod_SOURCES, terminal_mod_CFLAGS)
1112 (ls_mod_SOURCES, ls_mod_CFLAGS, cmp_mod_SOURCES, cmp_mod_CFLAGS)
1113 (cat_mod_SOURCES, cat_mod_CFLAGS, font_mod_SOURCES)
1114 (font_mod_CFLAGS, amiga_mod_SOURCES, amiga_mod_CFLAGS)
1115 (apple_mod_SOURCES, apple_mod_CFLAGS, pc_mod_SOURCES)
1116 (pc_mod_CFLAGS): New variables.
1117 * disk/powerpc/ieee1275/ofdisk.c: Include <grub/machine/init.h>.
1118 (grub_ofdisk_iterate): Add a prototype for `dev_iterate'.
1119 * include/grub/dl.h (grub_arch_dl_sync_caches): New prototype.
1120 * include/grub/loader.h (grub_os_area_addr, grub_os_area_size):
1121 Moved from here...
1122 * include/grub/i386/pc/init.h (grub_os_area_addr)
1123 (rub_os_area_size): ... to here.
1124 * include/grub/powerpc/ieee1275/ieee1275.h
1125 (grub_ieee1275_entry_fn): Export symbol.
1126 * include/grub/powerpc/ieee1275/init.h: New file.
1127 * include/grub/powerpc/libgcc.h: Likewise.
1128 * include/grub/cache.h: Likewise.
1129 * kern/powerpc/cache.S: Likewise. Written by Hollis Blanchard
1130 <hollis@penguinppc.org>.
1131 * kern/dl.c: Include <grub/cache.h>.
1132 (grub_dl_flush_cache): New function.
1133 (grub_dl_load_core): Call `grub_dl_flush_cache' to flush the cache
1134 for this module.
1135 * kern/powerpc/ieee1275/init.c (grub_ofdisk_init)
1136 (grub_console_init): Removed prototypes.
1137 (grub_machine_init): Don't initialize the modules anymore.
1138 * kern/powerpc/ieee1275/openfw.c (grub_map): Make the function
1139 static.
1140 * include/grub/powerpc/types.h (GRUB_HOST_WORDS_LITTLEENDIAN):
1141 Macro undef removed.
1142 (GRUB_HOST_WORDS_BIGENDIAN): New macro.
1143 * kern/powerpc/dl.c (grub_arch_dl_relocate_symbols): Add
1144 relocation `R_PPC_REL32'. Return an error when the relocation is
1145 unknown.
1146 * Makefile.in (DATA): Add `$(pkgdata_PROGRAMS)'.
1147 * kern/i386/pc/init.c (grub_arch_sync_caches): New function.
1148 * util/misc.c (grub_arch_sync_caches): Likewise.
1149
e4b47e0c 11502004-12-19 Marco Gerards <metgerards@student.han.nl>
1151
1152 * conf/powerpc-ieee1275.rmk (MOSTLYCLEANFILES): Remove
1153 `symlist.c', add `grubof_symlist.c'.
1154 (symlist.c): Variable removed.
1155 (grubof_HEADERS): Variable added.
1156 (grubof_symlist.c): New target.
1157 (kernel_syms.lst): Use `grubof_HEADERS' instead of
1158 `kernel_img_HEADERS'.
1159 (grubof_SOURCES): Add `kern/powerpc/dl.c' and `grubof_symlist.c'.
1160 * kern/powerpc/dl.c: New file.
1161 * kern/powerpc/ieee1275/init.c (grub_arch_dl_check_header):
1162 Function removed.
1163 (grub_arch_dl_relocate_symbols): Likewise.
1164 (grub_register_exported_symbols): Likewise.
1165
4ceb3636 11662004-12-13 Marco Gerards <metgerards@student.han.nl>
1167
1168 * fs/ext2.c (grub_ext2_open): Don't use data after freeing it.
1169 (grub_ext2_dir): Likewise. Don't return in case of an error, jump
1170 to fail instead. Reported by Vincent Pelletier
1171 <subdino2004@yahoo.fr>.
1172
1173 * fs/fshelp.c (grub_fshelp_find_file): Don't free `oldnode' when
1174 it is not allocated. Reported by Vincent Pelletier
1175 <subdino2004@yahoo.fr>.
1176
1177 * normal/cmdline.c (grub_tab_complete): Add a blank line to the
1178 output so the output looks better.
1179
3f1578fe 11802004-12-04 Marco Gerards <metgerards@student.han.nl>
1181
1182 Modulize the partition map support and add support for the amiga
1183 partition map.
1184
1185 * commands/ls.c: Include <grub/partition.h> instead of
1186 <grub/machine/partition.h>.
1187 * kern/disk.c: Likewise.
1188 * kern/rescue.c: Likewise.
1189 * loader/i386/pc/chainloader.c: Likewise.
1190 * normal/cmdline.c: Likewise.
1191 * kern/powerpc/ieee1275/init.c: Likewise.
1192 (grub_machine_init): Call `grub_pc_partition_map_init',
1193 `grub_amiga_partition_map_init' and
1194 `grub_apple_partition_map_init'.
1195 * conf/i386-pc.rmk (kernel_img_SOURCES): Remove
1196 `disk/i386/pc/partition.c'. Add `kern/partition.c'.
1197 (kernel_img_HEADERS): Remove `machine/partition.h'. Add
1198 `partition.h' and `pc_partition.h'.
1199 (grub_setup_SOURCES): Remove
1200 `disk/i386/pc/partition.c'. Add `kern/partition.c',
1201 `partmap/amiga.c', `partmap/apple.c' and `partmap/pc.c'.
1202 (grub_emu_SOURCES): Likewise.
1203 (pkgdata_MODULES): Add `amiga.mod', `apple.mod' and `pc.mod'.
1204 (amiga_mod_SOURCES, amiga_mod_CFLAGS, apple_mod_SOURCES)
1205 (apple_mod_CFLAGS, pc_mod_SOURCES, pc_mod_CFLAGS): New variables.
1206 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Remove
1207 `disk/powerpc/ieee1275/partition.c'. Add `kern/partition.c',
1208 `partmap/amiga.c', `partmap/apple.c' and `partmap/pc.c'.
1209 (grubof_SOURCES): Likewise.
1210 * disk/i386/pc/partition.c: File removed.
1211 * disk/powerpc/ieee1275/partition.c: Likewise.
1212 * include/grub/powerpc/ieee1275/partition.h: Likewise.
1213 * include/grub/i386/pc/partition.h: Likewise.
1214 * kern/partition.c: New file.
1215 * partmap/amiga.c: Likewise.
1216 * partmap/apple.c: Likewise.
1217 * partmap/pc.c: Likewise.
1218 * include/grub/partition.h: Likewise..
1219 * include/grub/pc_partition.h: Likewise.
1220 * util/grub-emu.c: Include <grub/partition.h> instead of
1221 <grub/machine/partition.h>.
1222 (main): Call `grub_pc_partition_map_init',
1223 `grub_amiga_partition_map_init' and
1224 `grub_apple_partition_map_init' and deinitialize afterwards.
1225 * util/i386/pc/biosdisk.c: Include `#include
1226 <grub/partition.h>' and `include <grub/pc_partition.h>' instead of
1227 `<grub/machine/partition.h>'.
1228 * util/i386/pc/grub-setup.c: Likewise.
1229 * util/i386/pc/biosdisk.c: Likewise.
1230 (grub_util_biosdisk_get_grub_dev): Only access the PC specific
1231 partition information in case of a PC partition.
1232 * util/i386/pc/grub-setup.c: Include `#include
1233 <grub/partition.h>' and `include <grub/pc_partition.h>' instead of
1234 `<grub/machine/partition.h>'.
1235 (setup): Only access the PC specific partition information in case
1236 of a PC partition.
1237
0ef4ced9 12382004-11-17 Hollis Blanchard <hollis@penguinppc.org>
1239
1240 * kern/powerpc/ieee1275/init.c (grub_setjmp): Remove function.
1241 (grub_longjmp): Likewise.
1242 * include/grub/powerpc/setjmp.h (grub_jmp_buf): Set array size to
1243 20.
1244 * normal/powerpc/setjmp.S: New file.
1245 * conf/powerpc-ieee1275.rmk (grubof_SOURCES): Add
1246 `normal/powerpc/setjmp.S'.
1247 (grubof_CFLAGS): Add `-DGRUBOF'.
1248 * include/grub/setjmp.h [GRUB_UTIL]: Changed condition to
1249 [GRUB_UTIL && !GRUBOF].
1250
19950e29 12512004-11-16 Marco Gerards <metgerards@student.han.nl>
1252
1253 * kern/powerpc/ieee1275/openfw.c (grub_devalias_iterate): Skip any
1254 property named `name'. Correctly handle the error returned by
1255 `grub_ieee1275_finddevice' if a device can not be opened.
1256
a2fea427 12572004-11-02 Hollis Blanchard <hollis@penguinppc.org>
1258
1259 * term/powerpc/ieee1275/ofconsole.c (grub_ofconsole_readkey): Test
1260 `actual' for negativity.
1261 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Remove
1262 kern/fshelp.c.
1263
41ea0ea3 12642004-11-01 Marco Gerards <metgerards@student.han.nl>
1265
1266 * term/i386/pc/vga.c (VGA_HEIGHT): Changed to 350.
1267 (PAGE_OFFSET): New macro.
1268 (CRTC_ADDR_PORT): Likewise.
1269 (CRTC_DATA_PORT): Likewise.
1270 (START_ADDR_HIGH_REGISTER): Likewise.
1271 (START_ADDR_LOW_REGISTER): Likewise.
1272 (GRAPHICS_ADDR_PORT): Likewise.
1273 (GRAPHICS_DATA_PORT): Likewise.
1274 (READ_MAP_REGISTER): Likewise.
1275 (INPUT_STATUS1_REGISTER): Likewise.
1276 (INPUT_STATUS1_VERTR_BIT): Likewise.
1277 (page): New variable.
1278 (wait_vretrace): New function.
1279 (set_read_map): Likewise.
1280 (set_start_address): Likewise.
1281 (grub_vga_init): Use mode 0x10 instead of mode 0x12. Switch to
1282 the right page.
1283 (check_vga_mem): Take the page into account.
1284 (write_char): Likewise.
1285 (write_cursor): Likewise.
1286 (scroll_up): Likewise. Copy the page to the page that is not
1287 shown and switch between both pages.
1288 (grub_vga_putchar): Fix off by one error.
1289 (grub_vga_cls): Wait for the vertical retrace. Take the page into
1290 account.
1291
ad0bd20b 12922004-11-01 Marco Gerards <metgerards@student.han.nl>
1293
1294 Add support for iso9660 (including rockridge).
1295
1296 * conf/i386-pc.rmk (grub_emu_SOURCES): Add fs/iso9660.c.
1297 (iso9660_mod_SOURCES): New variable.
1298 (iso9660_mod_CFLAGS): Likewise.
1299 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs/iso9660.c.
1300 * include/grub/fs.h (grub_iso9660_init): New prototype.
1301 * util/grub-emu.c (main): Call `grub_iso9660_init'.
1302 * fs/iso9660.c: New file.
1303
1304 * include/grub/misc.h (grub_strncat): New prototype.
1305 * kern/misc.c (grub_strncat): New function.
1306
1307 * fs/hfs.c (grub_hfs_mount): Translate the error
1308 `GRUB_ERR_OUT_OF_RANGE' to `GRUB_ERR_BAD_FS'.
1309 * fs/jfs.c (grub_jfs_mount): Likewise.
1310 * fs/ufs.c (grub_ufs_mount): Likewise.
1311
a5477a59 13122004-10-28 Hollis Blanchard <hollis@penguinppc.org>
1313
1314 * boot/powerpc/ieee1275/cmain.c (cmain): Remove asm statements
1315 which initialized BAT registers.
1316 * boot/powerpc/ieee1275/ieee1275.c (IEEE1275_CALL_ENTRY_FN,
1317 grub_ieee1275_common_hdr, INIT_IEEE1275_COMMON):
1318 Move from here...
1319 * include/grub/powerpc/ieee1275/ieee1275.h (IEEE1275_CALL_ENTRY_FN,
1320 grub_ieee1275_common_hdr, INIT_IEEE1275_COMMON):
1321 ... to here.
1322 * kern/powerpc/ieee1275/openfw.c (grub_map): New function.
1323 (grub_mapclaim): Likewise.
1324 * loader/powerpc/ieee1275/linux.c (grub_load_linux): Use
1325 grub_mapclaim instead of grub_ieee1275_claim. Assign linux_addr by
1326 hand.
1327
9304c1f8 13282004-10-19 Hollis Blanchard <hollis@penguinppc.org>
1329
1330 * conf/powerpc-ieee1275.rmk (COMMON_ASFLAGS): Remove -fno-builtin.
1331 (COMMON_CFLAGS): Remove -fno-builtin and -D__ASSEMBLY__. Add
1332 -ffreestanding and -msoft-float.
1333
86f4ae25 13342004-10-15 Hollis Blanchard <hollis@penguinppc.org>
1335
1336 * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_open): Do not
1337 append ":0" to devpath if the GRUB_IEEE1275_NO_PARTITION_0 flag is
1338 set in grub_ieee1275_flags.
1339
38912228 13402004-10-14 Hollis Blanchard <hollis@penguinppc.org>
1341
1342 * include/grub/powerpc/ieee1275/ieee1275.h (abort): Add function
1343 prototype.
1344 * kern/powerpc/ieee1275/init.c (grub_machine_init): Call
1345 grub_console_init first.
1346 Change the memory range used for grub_ieee1275_claim and
1347 grub_mm_init_region.
1348 Print an error message if the claim fails.
1349 Include <grub/misc.h>.
1350
d1923dc8 13512004-10-13 Hollis Blanchard <hollis@penguinppc.org>
1352
1353 * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_iterate):
1354 Call grub_children_iterate for device nodes of type `scsi',
1355 `ide', or `ata'.
1356 (grub_ofdisk_open): Remove manual device alias resolution.
1357 Fix memory leak when device cannot be opened.
1358 * include/grub/powerpc/ieee1275/ieee1275.h
1359 (grub_children_iterate): New prototype.
1360 * kern/powerpc/ieee1275/openfw.c (grub_children_iterate):
1361 New function.
1362 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_get_property):
1363 Return -1 if args.size was -1.
1364
4512e4f3 13652004-10-11 Hollis Blanchard <hollis@penguinppc.org>
1366
1367 * boot/powerpc/ieee1275/cmain.c (grub_ieee1275_flags): New global.
1368 (cmain): Accept 3 parameters. Test for 0xdeadbeef, indicating Old
1369 World Macintosh. If Old Wold, set flag in grub_ieee1275_flags; claim
1370 Open Firmware's memory for it; claim memory from _start to _end.
1371 * boot/powerpc/ieee1275/crt0.S (__bss_start): New extern.
1372 (_end): New extern.
1373 (_start): Zero BSS from __bss_start to _end.
1374 * include/grub/powerpc/ieee1275/ieee1275.h (grub_ieee1275_flags):
1375 New extern.
1376 (GRUB_IEEE1275_NO_PARTITION_0): New #define.
1377
4d61feb0 13782004-10-11 Hollis Blanchard <hollis@penguinppc.org>
1379
ad0bd20b 1380 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_claim): Return
1381 -1 if args.base was -1.
4d61feb0 1382
026fa2f9 13832004-10-08 Hollis Blanchard <hollis@penguinppc.org>
1384
1385 * term/powerpc/ieee1275/ieee1275.c (grub_ofconsole_cls): Use an ANSI
1386 escape sequence instead of a literal ^L. Also call
1387 grub_ofconsole_gotoxy.
1388
9f2220ef 13892004-10-03 Hollis Blanchard <hollis@penguinppc.org>
1390
1391 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_claim): change
1392 void * arguments to grub_addr_t. All callers updated. Also make
1393 the `result' argument optional.
1394 (grub_ieee1275_release): change void * arguments to grub_addr_t.
1395 All callers updated.
1396
8a572cd7 13972004-09-22 Hollis Blanchard <hollis@penguinppc.org>
1398
1399 * commands/ls.c (grub_ls_list_files): Use the string following the
1400 initial ')', if present, as the filesystem path.
1401 * kern/rescue.c (grub_rescue_cmd_ls): Likewise.
1402
1403 * conf/powerpc-ieee1275.rmk (grubof_SOURCES): List crt0.S first.
1404
18aa81f2 14052004-09-18 Yoshinori K. Okuji <okuji@enbug.org>
1406
1407 Make the source code of the menu interface more readable.
1408
1409 * normal/menu.c: Include grub/mm.h.
1410 (TERM_WIDTH): New macro.
1411 (TERM_HEIGHT): Likewise.
1412 (TERM_INFO_HEIGHT): Likewise.
1413 (TERM_MARGIN): Likewise.
1414 (TERM_SCROLL_WIDTH): Likewise.
1415 (TERM_TOP_BORDER_Y): Likewise.
1416 (TERM_LEFT_BORDER_X): Likewise.
1417 (TERM_BORDER_WIDTH): Likewise.
1418 (TERM_MESSAGE_HEIGHT): Likewise.
1419 (TERM_BORDER_HEIGHT): Likewise.
1420 (TERM_NUM_ENTRIES): Likewise.
1421 (TERM_FIRST_ENTRY_Y): Likewise.
1422 (TERM_ENTRY_WIDTH): Likewise.
1423 (TERM_CURSOR_X): Likewise.
1424 (draw_border): Use macros instead of magic numbers.
1425 (print_entry): Likewise.
1426 (print_entries): Likewise.
1427 (run_menu): Likewise. Also, handle the key 'e'.
1428 (run_menu_entry): Ignore empty command lines.
1429 (print_message): Added a new argument EDIT. If EDIT is true,
1430 print a different message.
1431 (init_page): Likewise.
1432 (edit_menu_entry): New function. Not implemented yet.
1433
b47efe30 14342004-09-17 Marco Gerards <metgerards@student.han.nl>
1435
1436 Add `linux.mod' and `multiboot.mod' so linux and multiboot kernels
1437 can be loaded from normal mode.
1438
1439 * conf/i386-pc.rmk (pkgdata_MODULES): Add `linux.mod' and
1440 `multiboot.mod'.
1441 (linux_mod_SOURCES, linux_mod_CFLAGS, multiboot_mod_SOURCES)
1442 (multiboot_mod_CFLAGS): New variables.
1443 * loader/i386/pc/linux_normal.c: New file.
1444 * loader/i386/pc/multiboot_normal.c: Likewise.
1445
1446 * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Don't use the
1447 attribute `unused'.
1448
1449 * fs/ext2.c (grub_ext2_iterate_dir): Fix typos in inode type. Use
1450 `fdiro' to read the mode information from instead of `diro'.
1451
1452 * fs/fshelp.c (grub_fshelp_find_file): Set type to foundtype after
1453 looking up a symlink.
1454
1455 * include/grub/normal.h (GRUB_COMMAND_FLAG_NO_ARG_PARSE): New
1456 macro.
1457 * normal/command.c (grub_command_execute): Don't parse the
1458 arguments when `GRUB_COMMAND_FLAG_NO_ARG_PARSE' is set in the
1459 flags of the command.
1460
1461 * normal/menu.c (grub_menu_run): Fix typo.
1462
da75ac71 14632004-09-14 Hollis Blanchard <hollis@penguinppc.org>
1464
1465 * kern/powerpc/ieee1275/init.c (abort): Trap into Open Firmware.
1466
1467 * term/powerpc/ieee1275/ofconsole.c (grub_ofconsole_gotoxy): Use
1468 `y + 1' instead of `y - 1'.
1469
1470 * conf/powerpc-ieee1275.rmk (grubof_LDFLAGS): Add `-N' and `-S'.
1471
062b24c2 14722004-09-14 Yoshinori K. Okuji <okuji@enbug.org>
1473
1474 From Hollis Blanchard <hollis@penguinppc.org>:
1475 * kern/misc.c (memmove): New alias for grub_memmove.
1476 (memcmp): New alias for grub_memcmp.
1477 (memset): New alias for grub_memset.
1478 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_get_property):
1479 Change "int handle" to "grub_ieee1275_phandle_t handle".
1480 * include/grub/powerpc/ieee1275/ieee1275.h
1481 (grub_ieee1275_get_property): Likewise.
1482
8ddad845 14832004-09-12 Tomas Ebenlendr <ebik@ucw.cz>
1484
1485 Added normal mode command `chainloader' as module chain.mod, which
1486 depends on normal.mod and _chain.mod.
1487
1488 * conf/i386-pc.rmk (pkgdata_MODULES): Add `chain.mod'.
1489 (chain_mod_SOURCES, chain_mod_CFLAGS): Variables added.
1490 * include/grub/i386/pc/loader.h (grub_rescue_cmd_chainloader):
1491 Deleted prototype.
1492 * loader/i386/pc/chainloader.c (grub_rescue_cmd_chainloader): All
1493 but arguments parsing moved to ...
1494 (grub_chainloader_cmd): ... here. New function.
1495 * include/grub/i386/pc/chainloader.h: New file.
1496 * loader/i386/pc/chainloader_normal.c: Likewise.
1497
2c1f4ce3 14982004-09-11 Marco Gerards <metgerards@student.han.nl>
1499
1500 * conf/i386-pc.rmk (kernel_img_SOURCES): Added kern/fshelp.c.
1501 (grub_mkimage_LDFLAGS): Likewise.
1502 (grub_emu_SOURCES): Likewise.
1503 (kernel_img_HEADERS): Added fshelp.h.
1504 * fs/ext2.c: Include <grub/fshelp.h>.
1505 (FILETYPE_REG): New macro.
1506 (FILETYPE_INO_REG): Likewise.
1507 (grub_ext_sblock): Renamed to `grub_ext2_sblock'.
1508 Changed all users.
1509 (ext2_block_group): Renamed to `grub_ext2_block_group'. Changed
1510 all users.
1511 (grub_fshelp_node): New struct.
1512 (grub_ext2_data): Added member `diropen'. Changed member `inode'
1513 to a pointer.
1514 (grub_ext2_get_file_block): Removed function.
1515 (grub_ext2_read_block): New function.
1516 (grub_ext2_read_file): Replaced parameter `data' by `node'.
1517 This function was written.
1518 (grub_ext2_mount): Read the root inode. Create a diropen struct.
1519 (grub_ext2_find_file): Removed function.
1520 (grub_ext2_read_symlink): New function.
1521 (grub_ext2_iterate_dir): Likewise.
1522 (grub_ext2_open): Rewritten.
1523 (grub_ext2_dir): Rewritten.
1524 * include/grub/fshelp.h: New file.
1525 * fs/fshelp.c: Likewise.
1526
3c52136a 15272004-09-10 Yoshinori K. Okuji <okuji@enbug.org>
1528
1529 * normal/menu.c: Include grub/loader.h and grub/machine/time.h.
1530 (print_message): Add a missing newline.
1531 (run_menu): Added timeout support.
1532 (run_menu_entry): New local function.
1533 (grub_menu_run): Added support for booting.
1534
1535 * kern/loader.c (grub_loader_is_loaded): New function.
1536
1537 * include/grub/powerpc/ieee1275/time.h: Include grub/symbol.h.
1538 (grub_get_rtc): Exported.
1539
1540 * include/grub/i386/pc/time.h: Include grub/symbol.h.
1541 (grub_get_rtc): Exported.
1542
1543 * include/grub/normal.h (struct grub_command_list): Remove
1544 constant from the member `command'.
1545
1546 * include/grub/loader.h (grub_loader_is_loaded): Declared.
1547
1548 * include/grub/err.h (GRUB_ERR_INVALID_COMMAND): New constant.
1549
1550 * conf/i386-pc.rmk (kernel_img_HEADERS): Added machine/time.h.
1551
aa033560 15522004-08-28 Marco Gerards <metgerards@student.han.nl>
1553
1554 Add support for the JFS filesystem.
1555
1556 * fs/jfs.c: New file.
1557 * include/grub/fs.h (grub_jfs_init): New prototype.
1558 (grub_jfs_fini): New prototype.
1559 * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/jfs.c.
1560 (grub_emu_SOURCES): Likewise.
1561 (pkgdata_MODULES): Add jfs.mod.
1562 (jfs_mod_SOURCES): New variable.
1563 (jfs_mod_CFLAGS): Likewise.
1564 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs.jfs.c.
1565 (grubof_SOURCES): Likewise.
1566 * util/grub-emu.c (main): Initialize and deinitialize JFS support.
1567
1568 * fs/fat.c (grub_fat_find_dir): Convert the filename little
1569 endian to the host endian.
1570 (grub_fat_utf16_to_utf8): Move function from there...
1571 * kern/misc.c (grub_utf16_to_utf8): ...to here. Do not convert
1572 the endianess of the source string anymore.
1573 * include/grub/misc.h (grub_utf16_to_utf8): New prototype.
1574
94bc45af 15752004-08-24 Marco Gerards <metgerards@student.han.nl>
1576
1577 * commands/boot.c (grub_boot_init) [GRUB_UTIL]: Make conditional.
1578 (grub_boot_fini) [GRUB_UTIL]: Likewise.
1579 (GRUB_MOD_INIT) [!GRUB_UTIL]: Likewise.
1580 (GRUB_MOD_FINI) [!GRUB_UTIL]: Likewise.
1581
1582 * fs/hfs.c (grub_hfs_find_node): Add a prototype for `node_found'.
1583 (grub_hfs_iterate_dir): Make the function static. Add prototypes
1584 for `node_found' and `it_dir'.
1585 (grub_hfs_dir): Add prototype for `dir_hook'.
1586
1587 * fs/minix.c (grub_minix_get_file_block): Add prototype for
1588 `grub_get_indir'. Rename `indir' in two blocks to `indir16'
1589 and `indir32' to silence a gcc warning.
1590
1591 * include/grub/fs.h (grub_hfs_init): New prototype.
1592 (grub_hfs_fini): Likewise.
1593
1594
97543f08 15952004-08-21 Yoshinori K. Okuji <okuji@enbug.org>
1596
1597 Each disk device has its own id now. This is useful to make use
1598 of multiple disk devices.
1599
1600 * include/grub/disk.h (grub_disk_dev_id): New enum.
1601 (GRUB_DISK_DEVICE_BIOSDISK_ID): New constant.
1602 (GRUB_DISK_DEVICE_OFDISK_ID): Likewise.
1603
1604 * disk/i386/pc/biosdisk.c (grub_biosdisk_dev): Specify
1605 GRUB_DISK_DEVICE_BIOSDISK_ID as an id.
1606
1607 * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_dev): Specify
1608 GRUB_DISK_DEVICE_OFDISK_ID as an id.
1609
1610 * util/i386/pc/biosdisk.c (grub_util_biosdisk_dev): Specify
1611 GRUB_DISK_DEVICE_BIOSDISK_ID as an id.
1612
1613 * include/grub/disk.h (struct grub_disk_dev): Added a new member
1614 "id" which is used by the cache manager.
1615
1616 * normal/main.c (grub_normal_init_page): Use "GNU GRUB" instead
1617 of just "GRUB".
1618
64372eb4 16192004-08-18 Marco Gerards <metgerards@student.han.nl>
1620
1621 * fs/hfs.c: New file.
1622 * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/hfs.c.
1623 (grub_emu_SOURCES): Likewise.
1624 (pkgdata_MODULES): Add hfs.mod.
1625 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs/hfs.c.
1626 (grubof_SOURCES): Likewise.
1627 * util/grub-emu.c (main): Initialize and deinitialize HFS support.
1628
1629 * include/grub/misc.h (grub_strncasecmp): Add prototype.
1630 * kern/misc.c (grub_strncasecmp): Add function.
1631
cc61b58f 16322004-08-14 Marco Gerards <metgerards@student.han.nl>
1633
1634 * include/grub/arg.h (GRUB_ARG_OPTION_OPTIONAL): Surround macro
1635 with parentheses.
1636
1637 * fs/ext2.c (FILETYPE_UNKNOWN): New macro.
1638 (grub_ext2_dir): In case the directory entry type is unknown, read
1639 it from the inode.
1640
0ef123f6 16412004-08-02 Peter Bruin <pjbruin@dds.nl>
1642
1643 * loader/powerpc/ieee1275/linux.c (grub_linux_init): Pass
1644 grub_load_linux instead of grub_rescue_cmd_linux as second
1645 argument of grub_rescue_register_command.
1646
1647 * Makefile.in (RMKFILES): Add conf/powerpc-ieee1275.rmk.
1648
a447c5df 16492004-07-27 Marco Gerards <metgerards@student.han.nl>
1650
1651 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_release): New
1652 function.
1653 * commands/boot.c: Remove the check for `GRUB_UTIL'.
1654 * conf/powerpc-ieee1275.rmk (grubof_SOURCES): Add
1655 `loader/powerpc/ieee1275/linux.c',
1656 `loader/powerpc/ieee1275/linux_normal.c' and `commands/boot.c'.
1657 * include/grub/powerpc/ieee1275/ieee1275.h
1658 (grub_ieee1275_release): New prototype.
1659 * include/grub/powerpc/ieee1275/loader.h: Rewritten.
1660 * kern/powerpc/ieee1275/init.c (grub_machine_init): Initialize
1661 normal, boot, linux and linux_normal.
1662 * loader/powerpc/ieee1275/linux.c: New file.
1663 * loader/powerpc/ieee1275/linux_normal.c: Likewise.
1664
5a9e3546 16652004-07-12 Marco Gerards <metgerards@student.han.nl>
1666
1667 * normal/arg.c (grub_arg_parse): Correct error handling after
1668 reallocating the argumentlist (check if `argl' is not null instead
1669 of checking if `args' is not null).
1670 * kern/mm.c (grub_realloc): Return the same pointer when using the
1671 same region, instead of returning the header address.
1672
e15199cb 16732004-07-11 Marco Gerards <metgerards@student.han.nl>
1674
1675 * disk/powerpc/ieee1275/partition.c (grub_partition_iterate): Skip
1676 one block instead of two when looking for the initial partition.
1677 (grub_partition_probe): Initialize the local variable `p' with 0.
1678 Use base 10 for the grub_strtoul call.
1679 * kern/misc.c (grub_strncpy): Fix off by one bug. Eliminated the
1680 need for one local variable.
1681 (grub_strtoul): Don't add the new value to `num', instead of that
1682 just assign it.
1683
020616c2 16842004-07-11 Marco Gerards <metgerards@student.han.nl>
1685
1686 * conf/i386-pc.rmk (pkgdata_IMAGE): Add pxeboot.img.
1687 (pxeboot_img_SOURCES): New variable.
1688 (pxeboot_img_ASFLAGS): Likewise.
1689 (pxeboot_img_LDFLAGS): Likewise.
1690 * boot/i386/pc/pxeboot.S: New file. Based on pxeloader.S from
1691 GRUB Legacy and boot.S. Adopted for GRUB 2 by lode leroy
1692 <lode_leroy@hotmail.com>.
1693
6c51eb64 16942004-06-27 Tomas Ebenlendr <ebik@ucw.cz>
1695
1696 * kern/rescue.c (grub_enter_rescue_mode): Don't continue when
1697 there was no input.
1698
cfb12aff 16992004-06-27 Tomas Ebenlendr <ebik@ucw.cz>
1700
1701 * normal/cmdline.c (grub_set_history): Fix off by one bug. Fixed
1702 the history buffer logic.
1703
6eabba74 17042004-06-27 Tomas Ebenlendr <ebik@ucw.cz>
1705
1706 * fs/ext2.c (FILETYPE_INO_MASK, FILETYPE_INO_DIRECTORY)
1707 (FILETYPE_INO_SYMLINK): New macros.
1708 (grub_ext2_find_file): Check if the node is a directory using the
1709 inode stat information instead of using the filetype in the
1710 dirent. Exclude the first character of an absolute symlink.
1711 (grub_ext2_dir): Mask out the filetype part of the mode member of
1712 the inode.
1713
66e19ef8 17142004-05-24 Marco Gerards <metgerards@student.han.nl>
1715
1716 Add support for UFS version 1 and 2. Add support for the minix
1717 filesystem version 1 and 2, both the variants with 14 and 30 long
1718 filenames.
1719
1720 * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/ufs.c and
1721 fs/minix.c.
1722 (grub_emu_SOURCES): Likewise.
1723 (pkgdata_MODULES): Add ufs.mod and minix.mod.
1724 (ufs_mod_SOURCES): New variable.
1725 (ufs_mod_CFLAGS): Likewise.
1726 (minix_mod_SOURCES): Likewise.
1727 (minix_mod_CFLAGS): Likewise.
1728 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs/ufs.c and
1729 fs/minix.c.
1730 (grubof_SOURCES): Likewise.
1731 * fs/ufs.c: New file.
1732 * fs/minix.c: New file.
1733 * include/grub/fs.h (grub_ufs_init): New prototype.
1734 (grub_ufs_fini): Likewise.
1735 (grub_minix_init): Likewise.
1736 (grub_minix_fini): Likewise.
1737 * util/grub-emu.c (main): Initialize and deinitialize UFS and
1738 minix fs.
1739
cc2e748a 17402004-04-30 Jeroen Dekkers <jeroen@dekkers.cx>
1741
1742 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add normal/arg.c,
1743 commands/ls.c, commands/terminal.c, commands/boot.c,
1744 commands/cmp.c and commands/cat.c.
1745 (grubof_LDFLAGS): Add -nostdlib -static-libgcc -lgcc.
1746
1747 * kern/powerpc/ieee1275/init.c: Include "grub/env.h" instead of
1748 "env.h"
1749
4b13b216 17502004-04-04 Yoshinori K. Okuji <okuji@enbug.org>
1751
1752 All symbols prefixed with PUPA_ and pupa_ are renamed to GRUB_
1753 and grub_, respectively. Because the conversion is trivial and
1754 mechanical, I omit the details here. Please refer to the CVS
1755 if you need more information.
1756
6a142551 17572004-04-04 Yoshinori K. Okuji <okuji@enbug.org>
1758
1759 * include/pupa: Renamed to ...
1760 * include/grub: ... this.
1761 * util/i386/pc/pupa-mkimage.c: Renamed to ...
1762 * util/i386/pc/grub-mkimage.c: ... this.
1763 * util/i386/pc/pupa-setup.c: Renamed to ...
1764 * util/i386/pc/grub-setup.c: ... this.
1765 * util/pupa-emu.c: Renamed to ...
1766 * util/grub-emu.c: ... this.
1767
e56cdf21 17682004-03-29 Marco Gerards <metgerards@student.han.nl>
1769
1770 Add support for the newworld apple macintosh (PPC). This has been
1771 tested on the powerbook 2000 only. It only adds support for
1772 generic ieee1275 functions, console and disk support. This should
1773 be easy to port to other architectures with support for Open
1774 Firmware.
1775
1776 * configure.ac: Accept the powerpc as host_cpu. In the case of
1777 the powerpc cpu set the host_vendor to ieee1275. Make sure the i386
1778 specific tests are only executed while building for the i386.
1779 Inverse test for crosscompile.
1780 * genmk.rb (Utility): Allow assembler files.
1781 * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno.
1782 * conf/powerpc-ieee1275.rmk: New file.
1783 * disk/powerpc/ieee1275/ofdisk.c: Likewise.
1784 * disk/powerpc/ieee1275/partition.c: Likewise.
1785 * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise.
1786 * include/pupa/powerpc/ieee1275/console.h: Likewise.
1787 * include/pupa/powerpc/ieee1275/partition.h: Likewise.
1788 * include/pupa/powerpc/ieee1275/time.h: Likewise.
1789 * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise.
1790 * include/pupa/powerpc/ieee1275/multiboot.h: Likewise.
1791 * include/pupa/powerpc/ieee1275/loader.h
1792 * include/pupa/powerpc/setjmp.h: Likewise.
1793 * include/pupa/powerpc/types.h: Likewise.
1794 * kern/powerpc/ieee1275/init.c: Likewise.
1795 * kern/powerpc/ieee1275/openfw.c: Likewise.
1796 * term/powerpc/ieee1275/ofconsole.c: Likewise.
1797
1798 These files were written by Johan Rydberg
1799 (jrydberg@night.trouble.net) and I only modified them slightly.
1800
1801 * boot/powerpc/ieee1275/cmain.c: New file.
1802 * boot/powerpc/ieee1275/crt0.S: Likewise.
1803 * boot/powerpc/ieee1275/ieee1275.c: Likewise.
1804 * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
1805
8c8cc205 18062004-03-14 Jeroen Dekkers <jeroen@dekkers.cx>
1807
1808 * Makefile.in: Update copyright.
1809 * genmodsrc.sh: Likewise.
1810 * gensymlist.sh: Likewise.
1811 * term/i386/pc/vga.c: Indent correctly.
1812
1813 * util/i386/pc/pupa-mkimage.c (usage): Use PACKAGE_BUGREPORT as
1814 bugreporting address.
1815 * util/i386/pc/pupa-setup.c (usage): Likewise,
1816 (main): Call pupa_ext2_init and pupa_ext2_fini.
1817
1818 * fs/fat.c (log2): Renamed to ...
1819 (fat_log2): ... this.
1820 All callers changed.
1821 * kern/misc.c (memcpy): Alias to pupa_memmove.
1822 * loader/i386/pc/multiboot.c (pupa_rescue_cmd_multiboot): Fix
1823 lvalue cast.
1824 * util/console.c (pupa_ncurses_fini): Return 0.
1825
1826 * util/i386/pc/biosdisk.c (pupa_util_biosdisk_open)[__linux__]:
1827 Move fail label here.
1828 [__GNU__]: Don't warn when using stat.
1829 (open_device)[!__linux__]: Check if FD < 0 instead of !FD.
1830 (pupa_util_biosdisk_get_pupa_dev)[__GNU__]: Change type of N to
1831 long int. Use strtol instead of strtoul.
1832
db1771cf 18332004-03-14 Marco Gerards <metgerards@student.han.nl>
1834
1835 * commands/boot.c: New file.
1836 * commands/cat.c: Likewise.
1837 * commands/cmp.c: Likewise.
1838 * commands/ls.c: Likewise.
1839 * commands/terminal.c: Likewise.
1840 * normal/command.c: Include <pupa/env.h> and <pupa/dl.h>.
1841 (pupa_register_command): Changed interface to match the new
1842 argument parser.
1843 (pupa_command_execute): Changed (almost rewritten) so it uses
1844 pupa_split_command. Added support for setting variables using the
1845 syntax `foo=bar'.
1846 (rescue_command): Changed to work with the new argument parser.
1847 (terminal_command): Moved from here to commands/terminal.c.
1848 (set_command): New function.
1849 (unset_command): New function.
1850 (insmod_command): New function.
1851 (rmmod_command): New function.
1852 (lsmod_command): New function.
1853 (pupa_command_init): Don't initialize the command terminal
1854 anymore. Initialize the commands set, unset, insmod, rmmod and
1855 lsmod.
1856 * conf/i386-pc.rmk (kernel_img_SOURCES): Add kern/env.c.
1857 (kernel_img_HEADERS): Add arg.h and env.h.
1858 (pupa_mkimage_LDFLAGS): Add kern/env.c.
1859 (pupa_emu_SOURCES): Add kern/env.c, commands/ls.c,
1860 commands/terminal.c commands/boot.c commands/cmp.c commands/cat.c,
1861 normal/arg.c.
1862 (pkgdata_MODULES): Add ls.mod, boot.mod, cmp.mod, cat.mod and
1863 terminal.mod.
1864 (normal_mod_SOURCES): Add normal/arg.c and normal/arg.c.
1865 (boot_mod_SOURCES): New variable.
1866 (terminal_mod_SOURCES): Likewise.
1867 (ls_mod_SOURCES): Likewise.
1868 (cmp_mod_SOURCES): Likewise.
1869 (cat_mod_SOURCES): Likewise.
1870
1871 * normal/arg.c: New file.
1872 * kern/env.c: Likewise.
1873 * include/pupa/arg.h: Likewise.
1874 * include/pupa/env.h: Likewise.
1875 * font/manager.c (font_command): Changed to match argument parsing
1876 interface changes.
1877 (PUPA_MOD_INIT): Likewise.
1878 * hello/hello.c (pupa_cmd_hello): Likewise.
1879 (PUPA_MOD_INIT): Likewise.
1880 * include/pupa/disk.h: Include <pupa/device.h>.
1881 (pupa_print_partinfo): New prototype.
1882 * include/pupa/dl.h (pupa_dl_set_prefix): Prototype removed.
1883 (pupa_dl_get_prefix): Likewise.
1884 * include/pupa/misc.h: Include <pupa/err.h>.
1885 (pupa_isgraph): New prototype.
1886 (pupa_isdigit): Likewise.
1887 (pupa_split_cmdline): Likewise.
1888 * include/pupa/normal.h: Include <pupa/arg.h>.
1889 (pupa_command): Changed the prototype of the member `func' to
1890 match the argument parsing interface. Added member `options'.
1891 (pupa_register_command): Updated to match function.
1892 (pupa_arg_parse): New prototype.
1893 (pupa_hello_init) [PUPA_UTIL]: New prototype.
1894 (pupa_hello_fini) [PUPA_UTIL]: Likewise.
1895 (pupa_ls_init) [PUPA_UTIL]: Likewise.
1896 (pupa_ls_fini) [PUPA_UTIL]: Likewise.
1897 (pupa_cat_init) [PUPA_UTIL]: Likewise.
1898 (pupa_cat_fini) [PUPA_UTIL]: Likewise.
1899 (pupa_boot_init) [PUPA_UTIL]: Likewise.
1900 (pupa_boot_fini) [PUPA_UTIL]: Likewise.
1901 (pupa_cmp_init) [PUPA_UTIL]: Likewise.
1902 (pupa_cmp_fini) [PUPA_UTIL]: Likewise.
1903 (pupa_terminal_init) [PUPA_UTIL]: Likewise.
1904 (pupa_terminal_fini) [PUPA_UTIL]: Likewise.
1905 * kern/disk.c: Include <pupa/file.h>.
1906 (pupa_print_partinfo): New function.
1907 * kern/dl.c: Include <pupa/env.h>.
1908 (pupa_dl_dir): Variable removed.
1909 (pupa_dl_load): Use the environment variable `prefix' instead of
1910 the variable pupa_dl_dir.
1911 (pupa_dl_set_prefix): Function removed.
1912 (pupa_dl_get_prefix): Likewise.
1913 * kern/i386/pc/init.c: Include <pupa/env.h>.
1914 (pupa_machine_init): Use the environment variable `prefix' instead of
1915 using pupa_dl_set_prefix to set the prefix.
1916 * kern/main.c: Include <pupa/env.h>.
1917 (pupa_set_root_dev): Use the environment variable `prefix' instead of
1918 using pupa_dl_get_prefix to get the prefix.
1919 * kern/misc.c: Include <pupa/env.h>.
1920 (pupa_isdigit): New function.
1921 (pupa_isgraph): Likewise.
1922 (pupa_ftoa): Likewise.
1923 (pupa_vsprintf): Added support for printing values of the type
1924 `double'. Make it possible to format variable output when using
1925 formatting like `%1.2%f'.
1926 (pupa_split_cmdline): New function.
1927 * kern/rescue.c: Include <pupa/env.h>.
1928 (next_word): Removed function.
1929 (pupa_rescue_cmd_prefix): Likewise.
1930 (pupa_rescue_cmd_set): New function.
1931 (pupa_rescue_cmd_unset): New function.
1932 (pupa_enter_rescue_mode): Use the `pupa_split_cmdline' function to
1933 split the command line instead of splitting it here. Added
1934 support for setting variables using the syntax `foo=bar'. Don't
1935 initialize the prefix command anymore. Initialized the set and
1936 unset commands.
1937 * normal/cmdline.c: Include <pupa/env.h>.
1938 (pupa_tab_complete): Added prototypes for print_simple_completion,
1939 print_partition_completion, add_completion, iterate_commands,
1940 iterate_dev, iterate_part and iterate_dir. Moved code to print
1941 partition information from here to kern/disk.c.
1942 (pupa_cmdline_run): Don't check if the funtion exists anymore.
1943 * normal/main.c: Include <pupa/env.h>.
1944 (pupa_rescue_cmd_normal): Use the environment variable `prefix'
1945 instead of using pupa_dl_get_prefix to get the prefix.
1946 * term/i386/pc/vga.c: Include <pupa/arg.h>.
1947 (check_vga_mem): Cast pointers to `void *' to silence a gcc
1948 warning.
1949 (pupa_vga_putchar) [! DEBUG_VGA]: Removed for this case.
1950 (pupa_vga_setcolor): Declare unused variables with `__attribute__
1951 ((unused))' to silence a gcc warning.
1952 (pupa_vga_setcolor): Likewise.
1953 (debug_command): Changed to match argument parsing
1954 interface changes.
1955 * util/pupa-emu.c: Include <pupa/env.h>.
1956 (options): Added 0's for unused fields to silence a gcc warning.
1957 (argp): Likewise.
1958 (main): Use the environment variable `prefix' instead of using
1959 pupa_dl_set_prefix to set the prefix. Initialize the commands ls,
1960 boot, cmp, cat and terminal. Finish the commands boot, cmp, cat
1961 and terminal.
1962
1963 * util/i386/pc/getroot.c: Include <pupa/i386/pc/util/biosdisk.h>.
1964 * util/misc.c: Include <malloc.h>.
1965 (pupa_malloc): Rewritten so errors are correctly reported.
1966 (pupa_realloc): Likewise.
1967 (pupa_memalign): Likewise.
1968 (pupa_mm_init_region): Declare unused variables with
1969 `__attribute__ ((unused))' to silence a gcc warning.
1970 * normal/i386/setjmp.S: Remove tab at the end of the file to
1971 silence a gcc warning.
1972 * loader/i386/pc/linux.c (pupa_rescue_cmd_initrd): Declare unused
1973 variables with `__attribute__ ((unused))' to silence a gcc
1974 warning.
1975 * loader/i386/pc/multiboot.c (pupa_multiboot_unload): Make the
1976 local variable i unsigned to silence a gcc warning.
1977
1978 * kern/term.c: Include <pupa/misc.h>.
1979 (pupa_more_lines): New variable.
1980 (pupa_more): Likewise.
1981 (pupa_putcode): When the pager is active pause at the end of every
1982 screen.
1983 (pupa_set_more): New function.
1984 * include/pupa/term.h (pupa_set_more): New prototype.
1985
1986
3b1139cb 19872004-03-07 Yoshinori K. Okuji <okuji@enbug.org>
1988
1989 Now this project is GRUB 2 rather than PUPA. The location of
1990 the CVS repository was moved to GRUB's.
1991
1992 * configure.ac: Use bug-grub as the reporting address.
1993 Use GRUB instead of PUPA.
1994 Change the version number to 1.90.
1995
8367695c 19962004-02-24 Yoshinori K. Okuji <okuji@enbug.org>
1997
1998 * genkernsyms.sh: Updated copyright information.
1999 * genmk.rb: Likewise.
2000 * genmodsrc.sh: Likewise.
2001 * gensymlist.sh: Likewise.
2002 * boot/i386/pc/boot.S: Likewise.
2003 * boot/i386/pc/diskboot.S: Likewise.
2004 * disk/i386/pc/biosdisk.c: Likewise.
2005 * disk/i386/pc/partition.c: Likewise.
2006 * font/manager.c: Likewise.
2007 * fs/ext2.c: Likewise.
2008 * fs/fat.c: Likewise.
2009 * include/pupa/boot.h: Likewise.
2010 * include/pupa/device.h: Likewise.
2011 * include/pupa/disk.h: Likewise.
2012 * include/pupa/dl.h: Likewise.
2013 * include/pupa/elf.h: Likewise.
2014 * include/pupa/err.h: Likewise.
2015 * include/pupa/file.h: Likewise.
2016 * include/pupa/font.h: Likewise.
2017 * include/pupa/fs.h: Likewise.
2018 * include/pupa/kernel.h: Likewise.
2019 * include/pupa/loader.h: Likewise.
2020 * include/pupa/misc.h: Likewise.
2021 * include/pupa/mm.h: Likewise.
2022 * include/pupa/net.h: Likewise.
2023 * include/pupa/normal.h: Likewise.
2024 * include/pupa/rescue.h: Likewise.
2025 * include/pupa/setjmp.h: Likewise.
2026 * include/pupa/symbol.h: Likewise.
2027 * include/pupa/term.h: Likewise.
2028 * include/pupa/types.h: Likewise.
2029 * include/pupa/i386/setjmp.h: Likewise.
2030 * include/pupa/i386/types.h: Likewise.
2031 * include/pupa/i386/pc/biosdisk.h: Likewise.
2032 * include/pupa/i386/pc/boot.h: Likewise.
2033 * include/pupa/i386/pc/console.h: Likewise.
2034 * include/pupa/i386/pc/init.h: Likewise.
2035 * include/pupa/i386/pc/kernel.h: Likewise.
2036 * include/pupa/i386/pc/linux.h: Likewise.
2037 * include/pupa/i386/pc/loader.h: Likewise.
2038 * include/pupa/i386/pc/memory.h: Likewise.
2039 * include/pupa/i386/pc/multiboot.h: Likewise.
2040 * include/pupa/i386/pc/partition.h: Likewise.
2041 * include/pupa/i386/pc/time.h: Likewise.
2042 * include/pupa/i386/pc/vga.h: Likewise.
2043 * include/pupa/i386/pc/util/biosdisk.h: Likewise.
2044 * include/pupa/util/getroot.h: Likewise.
2045 * include/pupa/util/misc.h: Likewise.
2046 * include/pupa/util/resolve.h: Likewise.
2047 * kern/device.c: Likewise.
2048 * kern/disk.c: Likewise.
2049 * kern/dl.c: Likewise.
2050 * kern/err.c: Likewise.
2051 * kern/file.c: Likewise.
2052 * kern/fs.c: Likewise.
2053 * kern/loader.c: Likewise.
2054 * kern/main.c: Likewise.
2055 * kern/misc.c: Likewise.
2056 * kern/mm.c: Likewise.
2057 * kern/rescue.c: Likewise.
2058 * kern/term.c: Likewise.
2059 * kern/i386/dl.c: Likewise.
2060 * kern/i386/pc/init.c: Likewise.
2061 * kern/i386/pc/lzo1x.S: Likewise.
2062 * kern/i386/pc/startup.S: Likewise.
2063 * loader/i386/pc/chainloader.c: Likewise.
2064 * loader/i386/pc/linux.c: Likewise.
2065 * loader/i386/pc/multiboot.c: Likewise.
2066 * normal/cmdline.c: Likewise.
2067 * normal/command.c: Likewise.
2068 * normal/main.c: Likewise.
2069 * normal/menu.c: Likewise.
2070 * normal/i386/setjmp.S: Likewise.
2071 * term/i386/pc/console.c: Likewise.
2072 * term/i386/pc/vga.c: Likewise.
2073 * util/console.c: Likewise.
2074 * util/genmoddep.c: Likewise.
2075 * util/misc.c: Likewise.
2076 * util/pupa-emu.c: Likewise.
2077 * util/resolve.c: Likewise.
2078 * util/unifont2pff.rb: Likewise.
2079 * util/i386/pc/biosdisk.c: Likewise.
2080 * util/i386/pc/getroot.c: Likewise.
2081 * util/i386/pc/pupa-mkimage.c: Likewise.
2082 * util/i386/pc/pupa-setup.c: Likewise.
2083
e6eced71 20842004-02-15 Jeroen Dekkers <jeroen@dekkers.cx>
2085
2086 * fs/ext2.c (pupa_ext2_read_file): Correct the value of BLOCKEND
2087 when it is EXT2_BLOCK_SIZE (data). New argument READ_HOOK, all
2088 callers changed. Set DATA->DISK->READ_HOOK to READ_HOOK before
2089 reading and reset it after reading.
2090 (pupa_ext2_close): Return PUPA_ERR_NONE.
2091
2092 * include/pupa/i386/pc/linux.h (PUPA_LINUX_INITRD_MAX_ADDRESS):
2093 Correct value.
2094 (struct linux_kernel_header): Add kernel_version and
2095 initrd_addr_max.
2096 * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Check whether
2097 pupa_file_read succeeds.
2098 (pupa_rescue_cmd_initrd): Implement.
2099
5aded270 21002003-12-03 Marco Gerards <metgerards@student.han.nl>
2101
2102 * fs/ext2.c (pupa_ext2_label): New function.
2103 (pupa_ext2_fs): Added label.
2104 * fs/fat.c (pupa_fat_label): New function.
2105 (pupa_fat_fs): Added label.
2106 * include/pupa/fs.h (struct pupa_fs): Added prototype label.
2107
2108 * kern/misc.c (pupa_strndup): New function.
2109 * include/pupa/misc.h (pupa_strndup): New prototype.
2110
2111 * include/pupa/normal.h: Include <pupa/err.h>.
2112 (pupa_set_history): New prototype.
2113 (pupa_iterate_commands): New prototype.
2114 * normal/cmdline.c: Include <pupa/machine/partition.h>,
2115 <pupa/disk.h>, <pupa/file.h>.
2116 (hist_size): New variable.
2117 (hist_lines): Likewise.
2118 (hist_end): Likewise.
2119 (hist_used): Likewise.
2120 (pupa_set_history): New function.
2121 (pupa_history_get): Likewise.
2122 (pupa_history_add): Likewise.
2123 (pupa_history_replace): Likewise.
2124 (pupa_tab_complete): Likewise.
2125 (pupa_cmdline_run): Added tab completion and history buffer. Tab
2126 completion shows partitionnames while completing partitions, this
2127 feature was suggested by Jeff Bailey.
2128 * normal/command.c (pupa_iterate_commands): New function.
2129 * normal/main.c (PUPA_DEFAULT_HISTORY_SIZE): New macro.
2130 (pupa_normal_init): Initialize history buffer.
2131 (PUPA_MOD_INIT): Likewise.
2132 (pupa_normal_fini): Free the history buffer.
2133 (PUPA_MOD_FINI): Likewise.
2134
2135 * util/console.c (pupa_ncurses_getkey): Accept 127 as backspace
2136 key.
2137
2138 * aclocal.m4 (pupa_I386_CHECK_REGPARM_BUG): New DEFUN.
2139 * configure.ac [i386]: Check for regparam bug.
2140 (NESTED_FUNC_ATTR) [! i386]: Defined.
2141
1f7315a3 21422003-11-17 Marco Gerards <metgerards@student.han.nl>
2143
2144 * conf/i386-pc.rmk (sbin_UTILITIES): Added pupa-emu.
2145 (pupa_setup_SOURCES): Added util/i386/pc/getroot.c.
2146 (pupa_emu_SOURCES): New variable.
2147 (pupa_emu_LDFLAGS): Likewise.
2148 * include/pupa/fs.h (pupa_ext2_init) [PUPA_UTIL]: New prototype.
2149 (pupa_ext2_fini) [PUPA_UTIL]: Likewise.
2150 * include/pupa/normal.h (pupa_normal_init) [PUPA_UTIL]: Likewise.
2151 (pupa_normal_fini) [PUPA_UTIL]: Likewise.
2152 * include/pupa/setjmp.h [PUPA_UTIL]: Include <setjmp.h>.
2153 (pupa_jmp_buf): New typedef.
2154 (pupa_setjmp) [PUPA_UTIL]: New macro.
2155 (pupa_longjmp) [PUPA_UTIL]: Likewise.
2156 * include/pupa/term.h (struct pupa_term): New member `refresh'.
2157 (pupa_refresh): New prototype.
2158 * include/pupa/util/getroot.h: New file.
2159 * kern/misc.c (pupa_vsprintf): Refresh the screen after updating
2160 it.
2161 * kern/rescue.c (pupa_rescue_get_command_line): Likewise.
2162 (pupa_rescue_cmd_cat): Likewise.
2163 (pupa_rescue_cmd_ls): Likewise.
2164 (pupa_rescue_cmd_testload): Likewise.
2165 (pupa_rescue_cmd_lsmod): Likewise.
2166 * normal/cmdline.c (pupa_cmdline_get): Likewise.
2167 * normal/menu.c (run_menu): Likewise.
2168 * kern/term.c (pupa_cls): Likewise.
2169 (pupa_refresh): New function.
2170 * normal/normal.c (pupa_normal_init) [PUPA_UTIL]: New function.
2171 (pupa_normal_fini) [PUPA_UTIL]: Likewise.
2172 * util/console.c: New file.
2173
2174 * util/i386/pc/getroot.c: New file.
2175 * util/i386/pc/pupa-setup.c: Include <pupa/util/getroot.h>.
2176 (pupa_putchar): New function.
2177 (pupa_refresh): Likewise.
2178 (xgetcwd): Function moved to ...
2179 (strip_extra_slashes): Likewise.
2180 (get_prefix): Likewise.
2181 * util/i386/pc/getroot.c: ... here.
2182 (find_root_device): Function moved and renamed to...
2183 * util/i386/pc/getroot.c (pupa_find_root_device): ... here.
2184 Changed all callers.
2185 * util/i386/pc/pupa-setup.c (guess_root_device): Function moved
2186 and renamed to...
2187 * util/i386/pc/getroot.c (pupa_guess_root_device): ... here.
2188 Changed all callers.
2189 * util/misc.c (pupa_memalign): New function.
2190 (pupa_mm_init_region): Likewise.
2191 (pupa_register_exported_symbols): Likewise.
2192 (pupa_putchar): Function removed.
2193 * util/pupa-emu.c: New file.
2194
9a5c1ade 21952003-11-16 Jeroen Dekkers <jeroen@dekkers.cx>
2196
2197 * conf/i386-pc.rmk (pkgdata_MODULES): Add _multiboot.mod.
2198 (_multiboot_mod_SOURCES): New variable.
2199 (_multiboot_mod_CFLAGS): Likewise.
2200 * loader/i386/pc/multiboot.c: New file.
2201 * include/pupa/i386/pc/multiboot.h: Likewise.
2202 * kern/i386/pc/startup.S: Include pupa/machine/multiboot.h.
2203 (pupa_multiboot_real_boot): New function.
2204 * include/pupa/i386/pc/loader.h: Include pupa/machine/multiboot.h.
2205 (pupa_multiboot_real_boot): New prototype.
2206 (pupa_rescue_cmd_multiboot): Likewise
2207 (pupa_rescue_cmd_module): Likewise.
2208
2209 * kern/loader.c (pupa_loader_set): Continue when
2210 pupa_loader_unload_func() fails.
2211 (pupa_loader_unset): New function.
2212 * include/pupa/loader.h (pupa_loader_unset): New prototype.
2213
2214 * kern/misc.c (pupa_stpcpy): New function.
2215 * include/pupa/misc.h (pupa_stpcpy): New prototype.
2216
8e72a9c0 22172003-11-12 Marco Gerards <metgerards@student.han.nl>
2218
2219 * disk/i386/pc/biosdisk.c (pupa_biosdisk_open): Correctly check
2220 for available extensions.
2221
2222 * include/pupa/i386/pc/time.h: New file.
2223 * kern/disk.c: Include <pupa/machine/time.h>.
2224 (PUPA_CACHE_TIMEOUT): New macro.
2225 (pupa_last_time): New variable.
2226 (pupa_disk_open): Flush the cache when there was a timeout.
2227 (pupa_disk_close): Reset the timer.
2228 * kern/i386/pc/startup.S (pupa_get_rtc): Renamed from
2229 pupa_currticks.
2230 * util/misc.c: Include <sys/times.h>
2231 (pupa_get_rtc): New function.
2232
c4adbd32 22332003-11-09 Jeroen Dekkers <jeroen@dekkers.cx>
2234
2235 * fs/ext2.c (struct pupa_ext2_inode): Declare struct datablocks
2236 as blocks.
2237 (pupa_ext2_get_file_block): Use blocks member.
2238
2239 * fs/ext2.c (pupa_ext2_read_file): Only set skipfirst for the
2240 first block. Return -1 instead of pupa_errno on error.
2241
bfd30f06 22422003-10-27 Marco Gerards <metgerards@student.han.nl>
2243
2244 * README: In the pupa-mkimage example use _chain instead of chain
2245 and ext2 instead of fat.
2246 * TODO: Replace ext2fs with jfs as an example. Add an item for
2247 adding journal playback for ext2fs.
2248 * conf/i386-pc.rmk (pupa_setup_SOURCES): Added fs/ext2.c.
2249 (pkgdata_MODULES): Added ext2.mod.
2250 (ext2_mod_SOURCES): New variable.
2251 (ext2_mod_CFLAGS): Likewise.
2252 * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_SYMLINK_LOOP.
2253 * include/pupa/misc.h (pupa_strncpy): New prototype.
2254 (pupa_strcat): Likewise.
2255 (pupa_strncmp): Likewise.
2256 * kern/misc.c (pupa_strcat): Enable function.
2257 (pupa_strncpy): New function.
2258 (pupa_strncmp): Likewise.
2259 * fs/ext2.c: New file.
2260
2261 * kern/disk.c (pupa_disk_read): Set pupa_errno to PUPA_ERR_NONE
2262 when the read failed before retrying.
2263 * util/i386/pc/biosdisk.c (_LARGEFILE_SOURCE): Removed.
2264 (_FILE_OFFSET_BITS): Likewise.
2265 * configure.ac: Added AC_SYS_LARGEFILE.
2266
98d15063 22672003-09-25 Yoshinori K. Okuji <okuji@enbug.org>
2268
2269 * genmk.rb (PModule#rule): Make sure to get only symbol names
2270 from the output of nm.
2271 Reported by Robert Millan <zeratul2@wanadoo.es>.
2272
18d9c7cd 22732003-09-25 Yoshinori K. Okuji <okuji@enbug.org>
2274
2275 I forgot to check in these changes for a long time. This adds
2276 incomplete support for VGA console, and this is still very
2277 buggy. Also, a lot of consideration is required for I18N,
2278 UNICODE, and VGA font issues. Therefore, assume that this is
2279 such that "better than nothing".
2280
2281 * font/manager.c: New file.
2282 * include/pupa/font.h: Likewise.
2283 * include/pupa/i386/pc/vga.h: Likewise.
2284 * term/i386/pc/vga.c: Likewise.
2285 * util/unifont2pff.rb: Likewise.
2286
2287 * conf/i386-pc.rmk (kernel_img_HEADERS): Added machine/vga.h.
2288 (pkgdata_MODULES): Added vga.mod and font.mod.
2289 (vga_mod_SOURCES): New variables.
2290 (vga_mod_CFLAGS): Likewise.
2291 (font_mod_SOURCES): Likewise.
2292 (font_mod_CFLAGS): Likewise.
2293
2294 * include/pupa/err.h (PUPA_ERR_BAD_FONT): New constant.
2295
2296 * include/pupa/term.h: Include pupa/err.h.
2297 (struct pupa_term): Added init and fini.
2298 Changed the argument of putchar to pupa_uint32_t.
2299
2300 * include/pupa/i386/pc/console.h: Include pupa/symbol.h.
2301 (pupa_console_real_putchar): New prototype.
2302 (pupa_console_putchar): Removed.
2303 (pupa_console_checkkey): Exported.
2304 (pupa_console_getkey): Likewise.
2305
2306 * kern/misc.c (pupa_vsprintf): Add support for UNICODE
2307 characters.
2308
2309 * kern/term.c (pupa_term_set_current): Rewritten.
2310 (pupa_putchar): Likewise.
2311 (pupa_putcode): New function.
2312
2313 * kern/i386/pc/startup.S (pupa_console_putchar): Renamed to ...
2314 (pupa_console_real_putchar): ... this.
2315 (pupa_vga_set_mode): New function.
2316 (pupa_vga_get_font): Likewise.
2317
2318 * normal/command.c: Include pupa/term.h.
2319 (terminal_command): New function.
2320 (pupa_command_init): Register the command "terminal".
2321
2322 * normal/menu.c (DISP_LEFT): Changed to a UNICODE value.
2323 (DISP_UP): Likewise.
2324 (DISP_RIGHT): Likewise.
2325 (DISP_DOWN): Likewise.
2326 (DISP_HLINE): Likewise.
2327 (DISP_VLINE): Likewise.
2328 (DISP_UL): Likewise.
2329 (DISP_UR): Likewise.
2330 (DISP_LL): Likewise.
2331 (DISP_LR): Likewise.
2332
2333 * term/i386/pc/console.c (pupa_console_putchar): New function.
2334
977329f5 23352003-02-08 NIIBE Yutaka <gniibe@m17n.org>
2336
2337 * util/resolve.c (pupa_util_resolve_dependencies): BUG
2338 FIX. Reverse the path_list.
2339
2340 * include/pupa/normal.h: Export pupa_register_command and
2341 pupa_unregister_command.
2342
2343 * hello/hello.c (pupa_cmd_hello): New module.
2344 * conf/i386-pc.rmk: Added hello.mod.
2345
1f5ab428 23462003-01-31 Yoshinori K. Okuji <okuji@enbug.org>
2347
2348 * kern/i386/pc/lzo1x.S: New file.
2349
2350 * util/i386/pc/pupa-mkimage.c: Include lzo1x.h.
2351 (compress_kernel): New variable.
2352 (generate_image): Heavily modified to support compressing a
2353 large part of the core image.
2354
2355 * util/misc.c (pupa_util_read_image): Fix a file descriptor
2356 leak.
2357 (pupa_util_load_image): New function.
2358
2359 * kern/i386/pc/startup.S: Include pupa/machine/kernel.h.
2360 (pupa_compressed_size): New variable.
2361 (codestart): Enable Gate A20 here.
2362 Decompress the compressed part of the core image.
2363 Rearrange the code to put functions and variables which are
2364 required for initialization in the non-compressed part.
2365 Include lzo1x.S.
2366
2367 * kern/i386/pc/init.c (pupa_machine_init): Don't enable Gate A20
2368 here.
2369
2370 * include/pupa/util/misc.h (pupa_util_write_image): Declared.
2371
2372 * include/pupa/i386/pc/kernel.h
2373 (PUPA_KERNEL_MACHINE_COMPRESSED_SIZE): New macro.
2374 (PUPA_KERNEL_MACHINE_INSTALL_DOS_PART): Increased by 4.
2375 (PUPA_KERNEL_MACHINE_INSTALL_BSD_PART): Likewise.
2376 (PUPA_KERNEL_MACHINE_PREFIX): Likewise.
2377 (PUPA_KERNEL_MACHINE_RAW_SIZE): New macro.
2378
2379 * conf/i386-pc.rmk (pupa_mkimage_LDFLAGS): New variable.
2380
2381 * genmk.rb (Image#rule): Put LDFLAGS at the end of a line.
2382 (Utility#rule): Likewise.
2383
2384 * configure.ac: Check if LZO is available.
2385
ce5bf700 23862003-01-20 Yoshinori K. Okuji <okuji@enbug.org>
2387
2388 * include/pupa/normal.h: New file.
2389 * include/pupa/setjmp.h: Likewise.
2390 * include/pupa/i386/setjmp.h: Likewise.
2391 * normal/cmdline.c: Likewise.
2392 * normal/command.c: Likewise.
2393 * normal/main.c: Likewise.
2394 * normal/menu.c: Likewise.
2395 * normal/i386/setjmp.S: Likewise.
2396
2397 * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global.
2398 (pupa_rescue_cmd_initrd): Likewise.
2399
2400 * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader):
2401 Likewise.
2402
2403 * kern/i386/pc/startup.S (translation_table): New variable.
2404 (translate_keycode): New function.
2405 (pupa_console_getkey): Call translate_keycode.
2406
2407 * kern/rescue.c (attempt_normal_mode): New function.
2408 (pupa_enter_rescue_mode): Attempt to execute the normal mode. If
2409 it failed, print a message.
2410
2411 * kern/mm.c (pupa_real_malloc): Print more information when a
2412 free magic is broken.
2413 (pupa_free): If the first free header is not free actually, set
2414 it to P.
2415
2416 * kern/main.c (pupa_load_normal_mode): Just load the module
2417 "normal".
2418 (pupa_main): Don't print the message
2419 "Entering into rescue mode..." here.
2420
2421 * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd):
2422 Declared.
2423 (pupa_rescue_cmd_initrd): Likewise.
2424 (pupa_rescue_cmd_initrd): Likewise.
2425
2426 * include/pupa/symbol.h (FUNCTION): Specify the type.
2427 (VARIABLE): Likewise.
2428
2429 * include/pupa/err.h (pupa_err_t): Added
2430 PUPA_ERR_UNKNOWN_COMMAND.
2431
2432 * include/pupa/dl.h (pupa_dl_set_prefix): Exported.
2433 (pupa_dl_get_prefix): Likewise.
2434
2435 * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod.
2436 Added _chain.mod and _linux.mod instead of chain.mod and
2437 linux.mod.
2438 (chain_mod_SOURCES): Renamed to ...
2439 (_chain_mod_SOURCES): ... this.
2440 (chain_mod_CFLAGS): Renamed to ...
2441 (_chain_mod_CFLAGS): ... this.
2442 (linux_mod_SOURCES): Renamed to ...
2443 (_linux_mod_SOURCES): ... this.
2444 (linux_mod_CFLAGS): Renamed to ...
2445 (_linux_mod_CFLAGS): ... this.
2446 (normal_mod_SOURCES): New variable.
2447 (normal_mod_CFLAGS): Likewise.
2448 (normal_mod_ASFLAGS): Likewise.
2449
24502003-01-18 Yoshinori K. Okuji <okuji@enbug.org>
2451
2452 * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if
2453 possible.
2454
2455 * kern/dl.c (pupa_dl_ref): Refer dependending modules
2456 recursively.
2457 (pupa_dl_unref): Unrefer depending modules recursively.
2458 Don't call pupa_dl_unload implicitly, because PUPA can crash if
2459 a module is unloaded before one depending on that module is
2460 unloaded.
2461 (pupa_dl_unload): Unload depending modules explicitly,
2462 if possible.
2463
c04da074 24642003-01-17 Yoshinori K. Okuji <okuji@enbug.org>
2465
2466 * include/pupa/i386/pc/linux.h: New file.
2467 * loader/i386/pc/linux.c: Likewise.
2468
2469 * loader/i386/pc/chainloader.c (pupa_chainloader_boot_sector):
2470 Removed.
2471 (pupa_chainloader_unload): Return PUPA_ERR_NONE.
2472 (pupa_rescue_cmd_chainloader): Read the image to 0x7C00 instead
2473 of PUPA_CHAINLOADER_BOOT_SECTOR.
2474
2475 * kern/i386/pc/startup.S: Include pupa/machine/linux.h.
2476 (pupa_linux_prot_size): New variable.
2477 (pupa_linux_tmp_addr): Likewise.
2478 (pupa_linux_real_addr): Likewise.
2479 (pupa_linux_boot_zimage): New function.
2480 (pupa_linux_boot_bzimage): Likewise.
2481
2482 * kern/i386/pc/init.c (struct mem_region): New structure.
2483 (MAX_REGIONS): New macro.
2484 (mem_regions): New variable.
2485 (num_regions): Likewise.
2486 (pupa_os_area_addr): Likewise.
2487 (pupa_os_area_size): Likewise.
2488 (pupa_lower_mem): Likewise.
2489 (pupa_upper_mem): Likewise.
2490 (add_mem_region): New function.
2491 (compact_mem_regions): Likewise.
2492 (pupa_machine_init): Set PUPA_LOWER_MEM and PUPA_UPPER_MEM to
2493 the size of the conventional memory and that of so-called upper
2494 memory (before the first memory hole).
2495 Instead of adding each found region to free memory, use
2496 add_mem_region and add them after removing overlaps.
2497 Also, add only 1/4 of the upper memory to free memory. The rest
2498 is used for loading OS images. Maybe this is ad hoc, but this
2499 makes it much easier to relocate OS images when booting.
2500
2501 * kern/rescue.c (pupa_rescue_cmd_module): Removed.
2502 (pupa_enter_rescue_mode): Don't register initrd and module.
2503
2504 * kern/mm.c: Include pupa/dl.h.
2505
2506 * kern/main.c: Include pupa/file.h and pupa/device.h.
2507
2508 * kern/loader.c (pupa_loader_load_module_func): Removed.
2509 (pupa_loader_load_module): Likewise.
2510
2511 * kern/dl.c (pupa_dl_load): Use the suffix ``.mod'' instead of
2512 ``.o''.
2513
2514 * include/pupa/i386/pc/loader.h (pupa_linux_prot_size): Declared.
2515 (pupa_linux_tmp_addr): Likewise.
2516 (pupa_linux_real_addr): Likewise.
2517 (pupa_linux_boot_zimage): Likewise.
2518 (pupa_linux_boot_bzimage): Likewise.
2519
2520 * include/pupa/i386/pc/init.h (pupa_lower_mem): Declared.
2521 (pupa_upper_mem): Likewise.
2522 (pupa_gate_a20): Don't export, because turning off Gate A20 in a
2523 module is too dangerous.
2524
2525 * include/pupa/loader.h (pupa_os_area_addr): Declared.
2526 (pupa_os_area_size): Likewise.
2527 (pupa_loader_set): Remove the first argument. Loader doesn't
2528 manage modules or initrd any longer.
2529 (pupa_loader_load_module): Removed.
2530
2531 * conf/i386-pc.rmk (pkgdata_MODULES): Added linux.mod.
2532 (linux_mod_SOURCES): New variable.
2533 (linux_mod_CFLAGS): Likewise.
2534
a13f9237 25352003-01-07 Yoshinori K. Okuji <okuji@enbug.org>
2536
2537 * util/i386/pc/pupa-setup.c (setup): Convert the endianness of
2538 the length of a blocklist correctly.
2539
2540 * util/i386/pc/biosdisk.c (pupa_util_biosdisk_open) [__linux__]:
2541 Use ioctl only if the OS file is a block device.
2542 (pupa_util_biosdisk_open): Don't use ST.ST_BLOCKS, because it is
2543 not very useful for normal files.
2544
2545 * kern/main.c (pupa_set_root_dev): New function.
2546 (pupa_load_normal_mode): Likewise.
2547 (pupa_main): Call those above.
2548
2549 * include/pupa/types.h (pupa_swap_bytes16): Cast the result to
2550 pupa_uint16_t.
2551
2552 * include/pupa/kernel.h (pupa_enter_normal_mode): Removed.
2553
a5ffe966 25542003-01-06 Yoshinori K. Okuji <okuji@enbug.org>
2555
2556 * util/i386/pc/pupa-setup.c: Include pupa/machine/kernel.h.
2557 (setup): Configure the installed partition information and the
2558 dl prefix.
2559
2560 * loader/i386/pc/chainloader.c (my_mod): New variable.
2561 (pupa_chainloader_unload): New function.
2562 (pupa_rescue_cmd_chainloader): Refer itself.
2563 (PUPA_MOD_INIT): Save its own module in MY_MOD.
2564
2565 * kern/i386/pc/startup.S (install_partition): Removed.
2566 (version_string): Likewise.
2567 (config_file): Likewise.
2568 (pupa_install_dos_part): New variable.
2569 (pupa_install_bsd_part): Likewise.
2570 (pupa_prefix): Likewise.
2571 (pupa_chainloader_real_boot): Call pupa_dl_unload_all.
2572
2573 * kern/i386/pc/init.c: Include pupa/machine/kernel.h, pupa/dl.h
2574 and pupa/misc.h.
2575 (make_install_device): New function.
2576 (pupa_machine_init): Set the dl prefix.
2577
2578 * kern/rescue.c: Include pupa/rescue.h and pupa/dl.h.
2579 (buf): Renamed to ...
2580 (linebuf): ... this.
2581 (pupa_rescue_cmd_prefix): New function.
2582 (pupa_rescue_cmd_insmod): Likewise.
2583 (pupa_rescue_cmd_rmmod): Likewise.
2584 (pupa_rescue_cmd_lsmod): Likewise.
2585 (pupa_enter_rescue_mode): Register new commands: prefix, insmod,
2586 rmmod and lsmod.
2587
2588 * kern/mm.c (pupa_memalign): If failed even after invalidating
2589 disk caches, unload unneeded modules and retry.
2590
2591 * kern/misc.c (pupa_memmove): New function.
2592 (pupa_memcpy): Removed.
2593 (pupa_strcpy): New function.
2594 (pupa_itoa): Made static.
2595
2596 * kern/dl.c (pupa_dl_iterate): New function.
2597 (pupa_dl_ref): Likewise.
2598 (pupa_dl_unref): Likewise.
2599 (pupa_dl_unload): Return if succeeded or not.
2600 (pupa_dl_unload_unneeded): New function.
2601 (pupa_dl_unload_all): Likewise.
2602 (pupa_dl_init): Renamed to ...
2603 (pupa_dl_set_prefix): ... this.
2604 (pupa_dl_get_prefix): New function.
2605
2606 * include/pupa/i386/pc/kernel.h: Include pupa/types.h.
2607 (PUPA_KERNEL_MACHINE_INSTALL_DOS_PART): New macro.
2608 (PUPA_KERNEL_MACHINE_INSTALL_BSD_PART): Likewise.
2609 (PUPA_KERNEL_MACHINE_PREFIX): Likewise.
2610 (pupa_install_dos_part): Declared.
2611 (pupa_install_bsd_part): Likewise.
2612 (pupa_prefix): Likewise.
2613 (pupa_boot_drive): Likewise.
2614
2615 * include/pupa/types.h: Fix a typo.
2616
2617 * include/pupa/misc.h (pupa_memcpy): New macro. Just an alias to
2618 pupa_memmove.
2619 (pupa_memmove): Declared.
2620 (pupa_strcpy): Likewise.
2621
2622 * include/pupa/dl.h (PUPA_MOD_INIT): Change the prototype. Now
2623 pupa_mod_init takes one argument, its own module.
2624 (pupa_dl_unload_unneeded): Declared.
2625 (pupa_dl_unload_all): Likewise.
2626 (pupa_dl_ref): Likewise.
2627 (pupa_dl_unref): Likewise.
2628 (pupa_dl_iterate): Likewise.
2629 (pupa_dl_init): Renamed to ...
2630 (pupa_dl_set_prefix): ... this.
2631 (pupa_dl_get_prefix): Declared.
2632
2633 * fs/fat.c [!PUPA_UTIL] (my_mod): New variable.
2634 (pupa_fat_dir) [!PUPA_UTIL]: Prevent the fat module from being
2635 unloaded.
2636 (pupa_fat_open) [!PUPA_UTIL]: Refer itself if succeeded.
2637 (pupa_fat_close) [!PUPA_UTIL]: Unrefer itself.
2638
2639 * configure.ac (tmp_CFLAGS): Added -Wshadow, -Wpointer-arith,
2640 -Wmissing-prototypes, -Wundef and -Wstrict-prototypes.
2641
012d7999 26422003-01-03 Yoshinori K. Okuji <okuji@enbug.org>
2643
2644 * util/i386/pc/pupa-setup.c (setup): Define the internal
2645 function find_first_partition_start at the top level, because GCC
2646 3.0.x cannot compile internal functions in deeper scopes
2647 correctly.
2648 (find_root_device): Use lstat instead of stat.
2649 Don't follow symbolic links.
2650 Fix the path-constructing code.
2651
2652 * util/i386/pc/biosdisk.c [__linux__] (BLKFLSBUF): New macro.
2653 (pupa_util_biosdisk_open) [__linux__]: Get the size of a device
2654 by a BLKGETSIZE ioctl first, because block devices don't fill
2655 the member st_mode of the structure stat on Linux.
2656 [__linux__] (linux_find_partition): Use a temporary buffer
2657 REAL_DEV for the working space. Copy it to DEV before returning.
2658 (open_device) [__linux__]: Call ioctl with BLKFLSBUF to make the
2659 buffer cache consistent.
2660 (get_os_disk) [__linux__]: Use the length 5 instead of 4 for
2661 strncmp. The previous value was merely wrong.
2662 (pupa_util_biosdisk_get_pupa_dev): Use stat instead of lstat.
2663
2664 * fs/fat.c (pupa_fat_read_data): Shift 4 instead of 12 when the
2665 FAT size is 12. The previous value was merely wrong.
2666
2667 * kern/main.c (pupa_main): Don't split the starting message from
2668 newlines.
2669
2670 * kern/term.c (pupa_putchar): Put CR after LF instead of before
2671 LF, because BIOS goes crazy about character attributes in this
2672 case.
2673
1cc73a62 26742003-01-03 Yoshinori K. Okuji <okuji@enbug.org>
2675
2676 * include/i386/pc/util/biosdisk.h: New file.
2677 * util/i386/pc/biosdisk.c: Likewise.
2678 * util/i386/pc/pupa-setup.c: Likewise.
2679
2680 * Makefile.in (INCLUDE_DISTFILES): Added
2681 include/pupa/i386/pc/util/biosdisk.h.
2682 (UTIL_DISTFILES): Added biosdisk.c and pupa-setup.c under the
2683 directory util/i386/pc.
2684 (install-local): Added a rule for sbin_UTILITIES.
2685 (uninstall): Likewise.
2686
2687 * util/i386/pc/pupa-mkimage.c (usage): Fix a typo in the doc.
2688
2689 * util/misc.c (xrealloc): New function.
2690 (pupa_malloc): Likewise.
2691 (pupa_free): Likewise.
2692 (pupa_realloc): Likewise.
2693 (pupa_stop): Likewise.
2694 (pupa_putchar): Likewise.
2695
2696 * kern/disk.c (pupa_disk_read): Prevent L from underflowing.
2697
2698 * include/pupa/util/misc.h (xrealloc): Declared.
2699
2700 * include/pupa/i386/pc/boot.h (PUPA_BOOT_MACHINE_BPB_START): New
2701 macro.
2702 (PUPA_BOOT_MACHINE_BPBEND): Renamed to ...
2703 (PUPA_BOOT_MACHINE_BPB_END): ... this.
2704
2705 * include/pupa/fs.h [PUPA_UTIL] (pupa_fat_init): Declared.
2706 [PUPA_UTIL] (pupa_fat_fini): Likewise.
2707
2708 * fs/fat.c [PUPA_UTIL] (pupa_fat_init): Defined. Maybe a better
2709 way should be implemented.
2710 [PUPA_UTIL] (pupa_fat_fini): Likewise.
2711
2712 * disk/i386/pc/biosdisk.c (pupa_biosdisk_call_hook): Increase
2713 the size of NAME for safety.
2714 (pupa_biosdisk_iterate): Search hard disks to 0x90 instead of
2715 0x88.
2716
2717 * conf/i386-pc.rmk (sbin_UTILITIES): New variable.
2718 (pupa_setup_SOURCES): Likewise.
2719
2720 * genmk.rb (Utility#rule): Add $(BUILD_CFLAGS) into the rules.
2721
08b70fe8 27222002-12-28 Yoshinori K. Okuji <okuji@enbug.org>
2723
2724 * kern/i386/pc/startup.S (push_get_mmap_entry): Revert to a
2725 bunch of pushl's from pusha, because this destroys the return
2726 value.
2727
62ddcc8f 27282002-12-28 Yoshinori K. Okuji <okuji@enbug.org>
2729
2730 Use -mrtd and -mregparm=3 to reduce the generated code sizes.
2731 This means that any missing prototypes could be fatal. Also, you
2732 must take care when writing assembly code. See the comments at
2733 the beginning of startup.S, for more details.
2734
2735 * kern/i386/pc/startup.S (pupa_halt): Modified for the new
2736 compilation mechanism.
2737 (pupa_chainloader_real_boot): Likewise.
2738 (pupa_biosdisk_rw_int13_extensions): Likewise.
2739 (pupa_biosdisk_rw_standard): Likewise.
2740 (pupa_biosdisk_check_int13_extensions): Likewise.
2741 (pupa_biosdisk_get_diskinfo_int13_extensions): Likewise.
2742 (pupa_biosdisk_get_diskinfo_standard): Likewise.
2743 (pupa_get_memsize): Likewise.
2744 (pupa_get_mmap_entry): Likewise.
2745 (pupa_console_putchar): Likewise.
2746 (pupa_console_setcursor): Likewise.
2747 (pupa_getrtsecs): Use pushl instead of push.
2748
2749 * kern/i386/pc/init.c (pupa_machine_init): Use the scratch
2750 memory instead of the stack for a mmap entry, because some
2751 BIOSes may ignore the maximum size and overflow.
2752
2753 * conf/i386-pc.rmk (COMMON_CFLAGS): Added -mrtd and -mregparm=3.
2754
2755 * genmk.rb (PModule#rule): Compile automatically generated
2756 sources with module-specific CFLAGS as well as other sources.
2757
9962ed99 27582002-12-27 Yoshinori K. Okuji <okuji@enbug.org>
2759
2760 * configure.ac: Check ld.
2761 Replace CFLAGS and CPPFLAGS with BUILD_CFLAGS and BUILD_CPPFLAGS
2762 respectively, before checking endianness and sizes.
2763
2764 * Makefile.in (LD): New variable.
2765
abdfc3c5 27662002-12-27 Yoshinori K. Okuji <okuji@enbug.org>
2767
2768 * Makefile.in (BUILD_CC): CC -> BUILD_CC.
2769
6a161fa9 27702002-12-27 Yoshinori K. Okuji <okuji@enbug.org>
2771
2772 * Changelog: New file.
2773