]> git.proxmox.com Git - grub2.git/blame - ChangeLog
2005-03-02 Yoshinori K. Okuji <okuji@enbug.org>
[grub2.git] / ChangeLog
CommitLineData
062aaf39 12005-03-02 Yoshinori K. Okuji <okuji@enbug.org>
2
3 * term/i386/pc/vga.c (debug_command): Removed.
4 (GRUB_MOD_INIT): Do not register the command "debug".
5
6 From Hollis Blanchard:
7 * commands/configfile.c: New file.
8 * conf/i386-pc.rmk (grub_emu_SOURCES): Added
9 commands/configfile.c.
10 (pkgdata_MODULES): Added configfile.mod.
11 (configfile_mod_SOURCES): New variable.
12 (configfile_mod_CFLAGS): Likewise.
13 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Added
14 commands/configfile.c.
15 (pkgdata_MODULES): Added configfile.mod.
16 (configfile_mod_SOURCES): New variable.
17 (configfile_mod_CFLAGS): Likewise.
18 * util/grub-emu.c (main): Call grub_configfile_init and
19 grub_configfile_fini.
20 * include/grub/normal.h [GRUB_UTIL] (grub_configfile_init): New
21 prototype.
22 [GRUB_UTIL] (grub_configfile_fini): Likewise.
23
cee01aa6 242005-02-27 Yoshinori K. Okuji <okuji@enbug.org>
25
26 * normal/arg.c (grub_arg_show_help): Do not show the bug report
27 address.
28
29 * commands/help.c (grub_cmd_help): Do not print newlines after
30 the last command in print_command_help.
31
93f3a1d8 322005-02-27 Yoshinori K. Okuji <okuji@enbug.org>
33
34 * commands/default.h: New file.
35 * commands/timeout.h: Likewise.
36 * normal/context.c: Likewise.
37
38 * util/misc.c: Do not include sys/times.h.
39 Include sys/time.h and grub/machine/time.h.
40 (grub_get_rtc): Rewritten with gettimeofday.
41
42 * util/grub-emu.c (main): Call grub_default_init and
43 grub_timeout_init before grub_normal_init, and call
44 grub_timeout_fini and grub_default_fini after grub_main.
45
46 * util/console.c (grub_ncurses_checkkey): Return the read
47 character or -1.
48
49 * normal/menu.c (run_menu): Set MENU->TIMEOUT to -1 once it
50 timeouts.
51
52 * normal/main.c (read_config_file): Push MENU. If this fails,
53 print an error and wait for a user input.
54 Print an error only if GRUB_ERRNO is not GRUB_ERR_NONE.
55 If a menu is empty or an error occurs, pop MENU.
56 (grub_normal_execute): Pop and free MENU after grub_menu_run
57 returns.
58
59 * kern/loader.c (grub_loader_boot): Call grub_machine_fini.
60
61 * include/grub/powerpc/ieee1275/time.h [GRUB_UTIL]: Do not
62 include time.h.
63 [GRUB_UTIL] (GRUB_TICKS_PER_SECOND): Use the same definition as
64 without GRUB_UTIL.
65 * include/grub/i386/pc/time.h [GRUB_UTIL]: Do not include
66 time.h.
67 [GRUB_UTIL] (GRUB_TICKS_PER_SECOND): Use the same definition as
68 without GRUB_UTIL.
69
70 * include/grub/normal.h (struct grub_menu_list): New struct.
71 (grub_menu_list_t): New type.
72 (struct grub_context): New struct.
73 (grub_context_t): New type.
74 (grub_register_command): Got rid of EXPORT_FUNC.
75 (grub_unregister_command): Likewise.
76 (grub_context_get): New prototype.
77 (grub_context_get_current_menu): Likewise.
78 (grub_context_push_menu): Likewise.
79 (grub_context_pop_menu): Likewise.
80 [GRUB_UTIL] (grub_default_init): Likewise.
81 [GRUB_UTIL] (grub_default_fini): Likewise.
82 [GRUB_UTIL] (grub_timeout_init): Likewise.
83 [GRUB_UTIL] (grub_timeout_fini): Likewise.
84
85 * conf/i386-pc.rmk (grub_emu_SOURCES): Added commands/default.c,
86 commands/timeout.c and normal/context.c.
87 (pkgdata_MODULES): Added default.mod and timeout.mod.
88 (normal_mod_SOURCES): Added normal/context.c.
89 (default_mod_SOURCES): New variable.
90 (default_mod_CFLAGS): Likewise.
91 (timeout_mod_SOURCES): Likewise.
92 (timeout_mod_CFLAGS): Likewise.
93 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Copied from
94 conf/i386-pc.rmk.
95 (pkgdata_MODULES): Added default.mod and timeout.mod.
96 (normal_mod_SOURCES): Added normal/context.c.
97 (default_mod_SOURCES): New variable.
98 (default_mod_CFLAGS): Likewise.
99 (timeout_mod_SOURCES): Likewise.
100 (timeout_mod_CFLAGS): Likewise.
101
102 * Makefile.in (all-local): Added $(MKFILES).
103
4ed2e1dd 1042005-02-21 Vincent Pelletier <subdino2004@yahoo.fr>
105
106 * conf/i386-pc.rmk (grub_setup_SOURCES): Add `partmap/sun.c'.
107 (grub_emu_SOURCES): Likewise.
108 (pkgdata_MODULES): Add `sun.mod'.
109 (sun_mod_SOURCES, sun_mod_CFLAGS): New variables.
110 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add
111 `partmap/sun.c'.
112 (pkgdata_MODULES): Add `sun.mod'.
113 (sun_mod_SOURCES, sun_mod_CFLAGS): New variables.
114 * include/grub/partition.h (grub_sun_partition_map_init): New
115 prototype.
116 (grub_sun_partition_map_fini): Likewise.
117 * partmap/sun.c: New file.
118 * util/grub-emu.c (main): Initialize and de-initialize the sun
119 partitionmap support.
120
4d4e372e 1212005-02-19 Yoshinori K. Okuji <okuji@enbug.org>
122
123 This implements an Emacs-like menu entry editor.
124
125 * normal/menu_entry.c: New file.
126
127 * util/console.c (grub_ncurses_putchar): Translate some Unicode
128 characters to ASCII.
129 (saved_char): New variable.
130 (grub_ncurses_checkkey): Rewritten completely.
131 (grub_ncurses_getkey): Likewise.
132 (grub_ncurses_init): Call raw instead of cbreak.
133
134 * normal/menu.c (print_entry): Do not put a space.
135 (init_page): Renamed to ...
136 (grub_menu_init_page): ... this. All callers changed.
137 (edit_menu_entry): Removed.
138 (run_menu): Call grub_menu_entry_run instead of edit_menu_entry.
139
140 * normal/cmdline.c (grub_cmdline_run): Call grub_setcursor.
141
142 * kern/misc.c (grub_vprintf): Call grub_refresh.
143
144 * normal/menu.c (DISP_LEFT): Renamed to ...
145 * include/grub/term.h (GRUB_TERM_DISP_LEFT): ... this.
146 * normal/menu.c (DISP_UP): Renamed to ...
147 * include/grub/term.h (GRUB_TERM_DISP_UP): ... this.
148 * normal/menu.c (DISP_RIGHT): Renamed to ...
149 * include/grub/term.h (GRUB_TERM_DISP_RIGHT): ... this.
150 * normal/menu.c (DISP_DOWN): Renamed to ...
151 * include/grub/term.h (GRUB_TERM_DISP_DOWN): ... this.
152 * normal/menu.c (DISP_HLINE): Renamed to ...
153 * include/grub/term.h (GRUB_TERM_DISP_HLINE): ... this.
154 * normal/menu.c (DISP_VLINE): Renamed to ...
155 * include/grub/term.h (GRUB_TERM_DISP_VLINE): ... this.
156 * normal/menu.c (DISP_UL): Renamed to ...
157 * include/grub/term.h (GRUB_TERM_DISP_UL): ... this.
158 * normal/menu.c (DISP_UR): Renamed to ...
159 * include/grub/term.h (GRUB_TERM_DISP_UR): ... this.
160 * normal/menu.c (DISP_LL): Renamed to ...
161 * include/grub/term.h (GRUB_TERM_DISP_LL): ... this.
162 * normal/menu.c (DISP_LR): Renamed to ...
163 * include/grub/term.h (GRUB_TERM_DISP_LR): ... this.
164 * normal/menu.c (TERM_WIDTH): Renamed to ...
165 * include/grub/term.h (GRUB_TERM_WIDTH): ... this.
166 * normal/menu.c (TERM_HEIGHT): Renamed to ...
167 * include/grub/term.h (GRUB_TERM_HEIGHT): ... this.
168 * normal/menu.c (TERM_INFO_HEIGHT): Renamed to ...
169 * include/grub/term.h (GRUB_TERM_INFO_HEIGHT): ... this.
170 * normal/menu.c (TERM_MARGIN): Renamed to ...
171 * include/grub/term.h (GRUB_TERM_MARGIN): ... this.
172 * normal/menu.c (TERM_SCROLL_WIDTH): Renamed to ...
173 * include/grub/term.h (GRUB_TERM_SCROLL_WIDTH): ... this.
174 * normal/menu.c (TERM_TOP_BORDER_Y): Renamed to ...
175 * include/grub/term.h (GRUB_TERM_TOP_BORDER_Y): ... this.
176 * normal/menu.c (TERM_LEFT_BORDER_X): Renamed to ...
177 * include/grub/term.h (GRUB_TERM_LEFT_BORDER_X): ... this.
178 * normal/menu.c (TERM_BORDER_WIDTH): Renamed to ...
179 * include/grub/term.h (GRUB_TERM_BORDER_WIDTH): ... this.
180 * normal/menu.c (TERM_MESSAGE_HEIGHT): Renamed to ...
181 * include/grub/term.h (GRUB_TERM_MESSAGE_HEIGHT): ... this.
182 * normal/menu.c (TERM_BORDER_HEIGHT): Renamed to ...
183 * include/grub/term.h (GRUB_TERM_BORDER_HEIGHT): ... this.
184 * normal/menu.c (TERM_NUM_ENTRIES): Renamed to ...
185 * include/grub/term.h (GRUB_TERM_NUM_ENTRIES): ... this.
186 * normal/menu.c (TERM_FIRST_ENTRY_Y): Renamed to ...
187 * include/grub/term.h (GRUB_TERM_FIRST_ENTRY_Y): ... this.
188 * normal/menu.c (TERM_ENTRY_WIDTH): Renamed to ...
189 * include/grub/term.h (GRUB_TERM_ENTRY_WIDTH): ... this.
190 * normal/menu.c (TERM_CURSOR_X): Renamed to ...
191 * include/grub/term.h (GRUB_TERM_CURSOR_X): ... this.
192 All callers changed.
193
194 * include/grub/normal.h: New prototype.
195
196 * conf/i386-pc.rmk (grub_emu_SOURCES): Added
197 normal/menu_entry.c.
198 (normal_mod_SOURCES): Likewise.
199 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise.
200 (normal_mod_SOURCES): Likewise.
201
e6b92c8a 2022005-02-15 Yoshinori K. Okuji <okuji@enbug.org>
203
204 * include/grub/normal.h (grub_halt_init): New prototype.
205 (grub_halt_fini): Likewise.
206 (grub_reboot_init): Likewise.
207 (grub_reboot_fini): Likewise.
208
209 * util/grub-emu.c: Include signal.h.
210 (main_env): New global variable.
211 (grub_machine_init): Ignore SIGINT. Otherwise grub-emu cannot
212 catch C-c.
213 (grub_machine_fini): New function.
214 (main): Call grub_halt_init and grub_reboot_init before
215 grub_main, and grub_reboot_fini and grub_halt_fini after it.
216 Call setjmp with MAIN_ENV to go back afterwards.
217 Call grub_machine_fini right before return.
218
219 * include/grub/util/misc.h: Include setjmp.h.
220 (main_env): New prototype.
221
222 * include/grub/kernel.h (grub_machine_fini): New prototype.
223 * include/grub/i386/pc/biosdisk.h (grub_biosdisk_fini): Likewise.
224 * include/grub/i386/pc/console.h (grub_console_fini): Likewise.
225
226 * disk/i386/pc/biosdisk.c (grub_biosdisk_fini): New function.
227 * kern/i386/pc/init.c (grub_machine_fini): Likewise.
228 * term/i386/pc/console.c (grub_console_fini): Likewise.
229
230 * util/i386/pc/misc.c: New file.
231
232 * conf/i386-pc.rmk (grub_emu_SOURCES): Added
233 util/i386/pc/misc.c, commands/i386/pc/halt.c and
234 commands/i386/pc/reboot.c.
235
c642636f 2362005-02-14 Guillem Jover <guillem@hadrons.org>
237
238 * include/grub/dl.h (grub_dl_check_header): New prototype.
239 (grub_arch_dl_check_header): Change return type to grub_err_t,
240 remove size parameter and export function. Update all callers.
241 * kern/dl.c (grub_dl_check_header): New function.
242 (grub_dl_load_core): Use `grub_dl_check_header' instead of
243 `grub_arch_dl_check_header'. Check ELF type. Check if sections
244 are inside the core.
245 * kern/i386/dl.c (grub_arch_dl_check_header): Remove arch
246 independent ELF header checks.
247 * kern/powerpc/dl.c (grub_arch_dl_check_header): Likewise.
248 * loader/i386/pc/multiboot.c (grub_rescue_cmd_multiboot): Use
249 `grub_dl_check_header' instead of explicit checks. Check for the
250 ELF type.
251 * loader/powerpc/ieee1275/linux.c (grub_rescue_cmd_linux): Use
252 `grub_dl_check_header' instead of explicit checks. Remove arch
253 specific ELF header checks.
254
e6b92c8a 255 * util/grub-emu.c (grub_arch_dl_check_header): Remove the
256 argument SIZE.
257
5eabe94b 2582005-02-13 Hollis Blanchard <hollis@penguinppc.org>
259
260 * conf/powerpc-ieee1275.rmk (pkgdata_MODULES): Add ls.mod.
261 * include/grub/powerpc/libgcc.h (__mulsf3): New prototype.
262
1b14a681 2632005-02-12 Hollis Blanchard <hollis@penguinppc.org>
264
265 * kern/partition.c (grub_partition_probe): Clear `grub_errno' and
266 return 0 if `grub_errno' is GRUB_ERR_BAD_PART_TABLE.
267 (part_map_iterate): Clear `grub_errno' and return 0 if
268 `partmap->iterate' returns GRUB_ERR_BAD_PART_TABLE.
269 * partmap/amiga.c (amiga_partition_map_iterate): Return
270 GRUB_ERR_BAD_PART_TABLE if no partition map magic is found.
271 * partmap/apple.c (apple_partition_map_iterate): Likewise.
272
aca108aa 2732005-02-01 Guillem Jover <guillem@hadrons.org>
274
275 * loader/i386/pc/multiboot_normal.c (GRUB_MOD_INIT): Fix module
276 help info.
277
c9f9c556 2782005-01-31 Marco Gerards <metgerards@student.han.nl>
279
280 * include/grub/powerpc/ieee1275/loader.h (grub_load_linux):
281 Removed prototype.
282 (grub_rescue_cmd_linux): New prototype.
283 (grub_rescue_cmd_initrd): Likewise.
284 * powerpc/ieee1275/linux.c (grub_linux_boot): Remove struct
285 `bi_rec'.
286 (grub_linux_release_mem): Release the memory for the initrd.
287 (grub_load_linux): Renamed from this...
288 (grub_rescue_cmd_linux): ...To this. Changed all callers.
289 Changed `entry' not to be static. Loop over memory regions to
290 find another one when the default fails.
291 (grub_rescue_cmd_initrd): New function.
292 (grub_linux_init): Remove function.
293 (grub_linux_fini): Likewise.
294 (GRUB_MOD_INIT): Register `initrd'.
295 (GRUB_MOD_FINI): Unregister `initrd'.
296 * powerpc/ieee1275/linux_normal.c (grub_linux_normal_init):
297 Function removed.
298 (grub_linux_normal_fini): Likewise.
299 (GRUB_MOD_INIT): Register `initrd'.
300 (GRUB_MOD_FINI): Unregister `initrd'.
301
990cf3aa 3022005-01-31 Marco Gerards <metgerards@student.han.nl>
303
304 * commands/help.c: New file.
305 * normal/arg.c (show_help): Renamed to...
306 (grub_arg_show_help): ... this.
307 * commands/i386/pc/halt.c: New file.
308 * commands/i386/pc/reboot.c: Likewise.
309 * conf/i386-pc.rmk (grub_emu_SOURCES): Add `commands/help.c'.
310 (pkgdata_MODULES): Add `reboot.mod', `halt.mod' and `help.mod'.
311 (help_mod_SOURCES, help_mod_CFLAGS, reboot_mod_SOURCES)
312 (reboot_mod_CFLAGS, halt_mod_SOURCES, halt_mod_CFLAGS): New
313 variables.
314 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add
315 `commands/help.c'.
316 (pkgdata_MODULES): Add `help.mod'.
317 (help_mod_SOURCES, help_mod_CFLAGS): New variables.
318 * grub/i386/pc/init.h (grub_reboot): New prototype.
319 (grub_halt): Likewise.
320 * include/grub/normal.h (grub_arg_show_help): New prototype.
321 (grub_help_init): Likewise.
322 (grub_help_fini): Likewise.
323 * util/grub-emu.c (main): Initialize and deinitialize the help
324 command.
325
326 * normal/cmdline.c (grub_cmdline_get): Doc fix.
327
328 * normal/command.c (grub_command_init): Fixed the description of
329 the `set' and `unset' commands.
330
3312005-01-31 Marco Gerards <metgerards@student.han.nl>
0f79cdc1 332
333 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_interpret): New
334 function.
335 * commands/ieee1275/halt.c: New file.
336 * commands/ieee1275/reboot.c: Likewise.
337 * commands/ieee1275/suspend.c (grub_cmd_suspend): Use
338 `__attribute__ ((unused))'. Some GCS related fixed.
339 (grub_suspend_init) [GRUB_UTIL]: Function removed.
340 (grub_suspend_fini): Likewise.
341 * conf/powerpc-ieee1275.rmk (pkgdata_MODULES): Add `reboot.mod'
342 and `halt.mod'.
343 (reboot_mod_SOURCES, reboot_mod_CFLAGS, halt_mod_SOURCES)
344 (halt_mod_CFLAGS): New variables.
345 * include/grub/powerpc/ieee1275/ieee1275.h
346 (grub_ieee1275_interpret): New prototype.
347
1ab09cc7 3482005-01-29 Yoshinori K. Okuji <okuji@enbug.org>
349
350 * include/grub/misc.h (memmove): New prototype.
351 (memcpy): Likewise.
352
8b8cbdb2 3532005-01-22 Hollis Blanchard <hollis@penguinppc.org>
354
355 * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_open): Don't initialize
356 `devpath' to 0. Use `name' instead of `devpath' with `grub_strndup'.
357
e3741a27 3582005-01-22 Marco Gerards <metgerards@student.han.nl>
359
360 * kern/misc.c (grub_strndup): Function rewritten.
361
776bd780 3622005-01-22 Vincent Pelletier <subdino2004@yahoo.fr>
363
364 * normal/menu.c (TERM_WIDTH): Macro redefined.
365 (TERM_TOP_BORDER_Y): Likewise.
366 (draw_border): Replaced while-loop by a for-loop. Make the number
367 of lines consistent with the number of lines displayed in
368 print_entries. Added a margin below the rectangle.
369 (print_entry): Make the entry fit in the rectangle.
370 (print_entries): Display the scroll arrows next to the right
371 border.
372
78026bce 3732005-01-21 Marco Gerards <metgerards@student.han.nl>
374
375 * fs/minix.c (grub_minix_find_file): Reserve more space for
376 `fpath' so the \0 can be stored. Use `grub_strcpy' instead of
377 `grub_strncpy' to copy `path' into it.
378
67bbaf0f 3792005-01-21 Marco Gerards <metgerards@student.han.nl>
380
381 Add the loopback device, a device via which files can be accessed
382 as devices.
383
384 * conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/loopback.c'.
385 (pkgdata_MODULES): Add loopback.mod.
386 (loopback_mod_SOURCES): New variable.
387 (loopback_mod_CFLAGS): Likewise.
388 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add
389 `disk/loopback.c'.
390 (pkgdata_MODULES): Add loopback.mod.
391 (loopback_mod_SOURCES): New variable.
392 (loopback_mod_CFLAGS): Likewise.
393 * disk/loopback.c: new file.
394 * include/grub/normal.h (grub_loop_init): New prototype.
395 (grub_loop_fini): New prototype.
396 * util/grub-emu.c (main): Initialize and de-initialize loopback
397 support.
398 * include/grub/disk.h (grub_disk_dev_id): Add
399 `GRUB_DISK_DEVICE_LOOPBACK_ID'.
400
6f1c18bd 4012005-01-20 Hollis Blanchard <hollis@penguinppc.org>
402
403 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_enter): New
404 function.
405 * conf/powerpc-ieee1275.rmk (pkgdata_MODULES): Add suspend.mod.
406 (suspend_mod_SOURCES): New variable.
407 (suspend_mod_CFLAGS): Likewise.
408 * include/grub/powerpc/ieee1275/ieee1275.h (grub_ieee1275_enter):
409 New prototype.
410 * commands/ieee1275/suspend.c: New file.
411
b38551da 4122005-01-20 Timothy Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
413
414 * include/grub/dl.h (GRUB_MOD_INIT): Changed `__attribute__
415 ((unused))' to `__attribute__ ((used))'.
416 (GRUB_MOD_FINI): Likewise.
417 * kern/dl.c (grub_dl_load_file): Fix null pointer dereference.
418 * genmk.rb (PModule): Assign space to common symbols when linking
419 modules.
420
777aff39 4212005-01-20 Marco Gerards <metgerards@student.han.nl>
422
423 * include/grub/mm.h (grub_mm_init_region): Change the type of the
424 `unsigned' arguments to `grub_size_t'.
425 (grub_malloc): Likewise.
426 (grub_realloc): Likewise.
427 (grub_memalign): Likewise.
428 * kern/i386/dl.c (grub_arch_dl_check_header): Likewise.
429 * kern/powerpc/dl.c (grub_arch_dl_check_header): Likewise.
430 * util/misc.c (grub_malloc): Likewise.
431 (grub_realloc): Likewise.
432 * kern/mm.c (get_header_from_pointer): Change the casts to
433 `unsigned' into a cast to `grub_size_t'.
434
435 * fs/fshelp.c (grub_fshelp_find_file): The `oldnode' should always
436 point to `currnode' when `currnode' is changed.
437
438 * util/grub-emu.c (main): Initialize `progname'. Reported by Nico
439 Schottelius <nico-linux@schottelius.org>.
440
d0ff18e1 4412005-01-09 Hollis Blanchard <hollis@penguinppc.org>
442
443 * util/powerpc/ieee1275/grub-mkimage.c: Include <string.h>.
444 (note_path): Remove variable.
445 (GRUB_IEEE1275_NOTE_NAME): New macro.
446 (GRUB_IEEE1275_NOTE_TYPE): Likewise.
447 (grub_ieee1275_note_hdr): New structure.
448 (grub_ieee1275_note_desc): Likewise.
449 (grub_ieee1275_note): Likewise.
450 (load_note): Remove `dir' argument. All callers updated. Remove
451 `note_img' and `path'. Do not load a file from `note_path'.
452 Initialize a struct grub_ieee1275_note and write that to `out'.
453 Use GRUB_IEEE1275_MODULE_BASE instead of MODULE_BASE.
454
4ca7004c 4552005-01-05 Marco Gerards <metgerards@student.han.nl>
456
457 * util/misc.c (grub_util_read_image): Revert last change. It
458 called `grub_util_read_at', which seeks from the beginning of the
459 file.
460
0b412211 4612005-01-04 Hollis Blanchard <hollis@penguinppc.org>
462
463 * TODO: Add note about endianness in grub-mkimage.
464 * boot/powerpc/ieee1275/crt0.S (note): Remove unused .note
465 section.
466 * conf/powerpc-ieee1275.rmk (bin_UTILITIES): Add grub-mkimage.
467 (grub_mkimage_SOURCES): New target.
468 * include/grub/kernel.h (grub_start_addr): Remove variable.
469 (grub_end_addr): Likewise.
470 (grub_total_module_size): Likewise.
471 (grub_kernel_image_size): Likewise.
472 (GRUB_MODULE_MAGIC): New constant.
473 (grub_module_info): New structure.
474 (grub_arch_modules_addr): New prototype.
475 (grub_get_end_addr): Remove prototype.
476 * include/grub/i386/pc/kernel.h (grub_end_addr): New prototype.
477 * include/grub/powerpc/ieee1275/kernel.h: New file.
478 * include/grub/util/misc.h (grub_util_get_fp_size): New
479 prototype.
480 (grub_util_read_at): Likewise.
481 (grub_util_write_image_at): Likewise.
482 * kern/main.c (grub_get_end_addr): Remove function.
483 (grub_load_modules): Call grub_arch_modules_addr instead of using
484 grub_end_addr. Look for a grub_module_info struct in memory. Use
485 the grub_module_info fields instead of calling grub_get_end_addr
486 as loop conditions. Move grub_add_unused_region code here.
487 (grub_add_unused_region): Remove function.
488 * kern/i386/pc/init.c: Include grub/cache.h.
489 (grub_machine_init): Remove call to grub_get_end_addr. Remove
490 one call to add_mem_region.
491 (grub_arch_modules_addr): New function.
492 * kern/powerpc/ieee1275/init.c (grub_end_addr): Remove variable.
493 (grub_total_module_size): Likewise.
494 Include grub/machine/kernel.h.
495 (grub_arch_modules_addr): New function.
496 * util/grub-emu.c (grub_end_addr): Remove variable.
497 (grub_total_module_size): Likewise.
498 (grub_arch_modules_addr): New function.
499 * util/misc.c: Include unistd.h.
500 (grub_util_get_fp_size): New function.
501 (grub_util_read_at): Likewise.
502 (grub_util_write_image_at): Likewise.
503 (grub_util_read_image): Call grub_util_read_at.
504 (grub_util_write_image): Call grub_util_write_image_at.
505 * util/i386/pc/grub-mkimage.c (generate_image): Allocate
506 additional memory in kernel_img for a struct grub_module_info.
507 Fill in that grub_module_info.
508 * util/powerpc/ieee1275/grub-mkimage.c: New file.
509
458786f8 5102005-01-03 Hollis Blanchard <hollis@penguinppc.org>
511
512 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_milliseconds):
513 New function.
514 * include/grub/powerpc/ieee1275/ieee1275.h
515 (grub_ieee1275_milliseconds): New prototype.
516 * include/grub/powerpc/ieee1275/time.h (GRUB_TICKS_PER_SECOND):
517 Change to 1000.
518 * kern/powerpc/ieee1275/init.c (grub_get_rtc): Call
519 grub_ieee1275_milliseconds.
520
ac507d1b 5212005-01-03 Hollis Blanchard <hollis@penguinppc.org>
522
523 * boot/powerpc/ieee1275/cmain.c (grub_ieee1275_realmode): New
524 variable.
525 (find_options): New function.
526 (cmain): Call find_options.
527 * include/grub/powerpc/ieee1275/ieee1275.h
528 (grub_ieee1275_realmode): New extern variable.
529 * kern/powerpc/ieee1275/openfw.c (grub_claimmap): Only call
530 grub_map if grub_ieee1275_realmode is false.
531
6b8fd1c4 5322004-12-29 Marco Gerards <metgerards@student.han.nl>
533
534 * normal/cmdline.c (grub_cmdline_get): Redone logic so no empty
535 lines are inserted and make it work like readline. Reported by
536 Vincent Pelletier <subdino2004@yahoo.fr>.
537
8514a1e0 5382004-12-28 Marco Gerards <metgerards@student.han.nl>
539
540 * boot/powerpc/ieee1275/crt0.S (_start): Don't set up the stack.
541
542 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCE): Remove
543 `kern/powerpc/cache.S'.
544
924b6140 5452004-12-27 Marco Gerards <metgerards@student.han.nl>
546
547 * genmk.rb: Handle the `Program' class in the main loop. Written
548 by Johan Rydberg <jrydberg@gnu.org>.
549 (Program): New class.
550 (programs): New variable.
551 * boot/powerpc/ieee1275/cmain.c: Include <grub/machine/ieee1275.h>
552 instead of "grub/machine/ieee1275.h". Include <grub/kernel.h>
553 instead of "grub/kernel.h". Include <grub/machine/init.h>.
554 (help_arch): Function removed.
555 * conf/powerpc-ieee1275.rmk (grubof_HEADERS): Add
556 `powerpc/libgcc.h' and `loader.h'.
557 (pkgdata_PROGRAMS): New variable.
558 (sbin_UTILITIES): Variable removed.
559 (grub_emu_SOURCES): Added kern/powerpc/cache.S.
560 (grubof_SOURCES): Variable re-defined so it only includes the
561 core functionality.
562 (grubof_CFLAGS): Remove `-DGRUBOF'.
563 (pkgdata_MODULES, fshelp_mod_SOURCES, fshelp_mod_CFLAGS,
564 (fat_mod_SOURCES, fat_mod_CFLAGS, ext2_mod_SOURCES)
565 (ext2_mod_CFLAGS, ufs_mod_SOURCES, ufs_mod_CFLAGS)
566 (minix_mod_SOURCES, minix_mod_CFLAGS, hfs_mod_SOURCES)
567 (hfs_mod_CFLAGS, jfs_mod_SOURCES, jfs_mod_CFLAGS)
568 (iso9660_mod_SOURCES, iso9660_mod_CFLAGS, _linux_mod_SOURCES)
569 (_linux_mod_CFLAGS, linux_mod_SOURCES, linux_mod_CFLAGS)
570 (normal_mod_SOURCES, normal_mod_CFLAGS, normal_mod_ASFLAGS)
571 (hello_mod_SOURCES, hello_mod_CFLAGS, boot_mod_SOURCES)
572 (boot_mod_CFLAGS, terminal_mod_SOURCES, terminal_mod_CFLAGS)
573 (ls_mod_SOURCES, ls_mod_CFLAGS, cmp_mod_SOURCES, cmp_mod_CFLAGS)
574 (cat_mod_SOURCES, cat_mod_CFLAGS, font_mod_SOURCES)
575 (font_mod_CFLAGS, amiga_mod_SOURCES, amiga_mod_CFLAGS)
576 (apple_mod_SOURCES, apple_mod_CFLAGS, pc_mod_SOURCES)
577 (pc_mod_CFLAGS): New variables.
578 * disk/powerpc/ieee1275/ofdisk.c: Include <grub/machine/init.h>.
579 (grub_ofdisk_iterate): Add a prototype for `dev_iterate'.
580 * include/grub/dl.h (grub_arch_dl_sync_caches): New prototype.
581 * include/grub/loader.h (grub_os_area_addr, grub_os_area_size):
582 Moved from here...
583 * include/grub/i386/pc/init.h (grub_os_area_addr)
584 (rub_os_area_size): ... to here.
585 * include/grub/powerpc/ieee1275/ieee1275.h
586 (grub_ieee1275_entry_fn): Export symbol.
587 * include/grub/powerpc/ieee1275/init.h: New file.
588 * include/grub/powerpc/libgcc.h: Likewise.
589 * include/grub/cache.h: Likewise.
590 * kern/powerpc/cache.S: Likewise. Written by Hollis Blanchard
591 <hollis@penguinppc.org>.
592 * kern/dl.c: Include <grub/cache.h>.
593 (grub_dl_flush_cache): New function.
594 (grub_dl_load_core): Call `grub_dl_flush_cache' to flush the cache
595 for this module.
596 * kern/powerpc/ieee1275/init.c (grub_ofdisk_init)
597 (grub_console_init): Removed prototypes.
598 (grub_machine_init): Don't initialize the modules anymore.
599 * kern/powerpc/ieee1275/openfw.c (grub_map): Make the function
600 static.
601 * include/grub/powerpc/types.h (GRUB_HOST_WORDS_LITTLEENDIAN):
602 Macro undef removed.
603 (GRUB_HOST_WORDS_BIGENDIAN): New macro.
604 * kern/powerpc/dl.c (grub_arch_dl_relocate_symbols): Add
605 relocation `R_PPC_REL32'. Return an error when the relocation is
606 unknown.
607 * Makefile.in (DATA): Add `$(pkgdata_PROGRAMS)'.
608 * kern/i386/pc/init.c (grub_arch_sync_caches): New function.
609 * util/misc.c (grub_arch_sync_caches): Likewise.
610
e4b47e0c 6112004-12-19 Marco Gerards <metgerards@student.han.nl>
612
613 * conf/powerpc-ieee1275.rmk (MOSTLYCLEANFILES): Remove
614 `symlist.c', add `grubof_symlist.c'.
615 (symlist.c): Variable removed.
616 (grubof_HEADERS): Variable added.
617 (grubof_symlist.c): New target.
618 (kernel_syms.lst): Use `grubof_HEADERS' instead of
619 `kernel_img_HEADERS'.
620 (grubof_SOURCES): Add `kern/powerpc/dl.c' and `grubof_symlist.c'.
621 * kern/powerpc/dl.c: New file.
622 * kern/powerpc/ieee1275/init.c (grub_arch_dl_check_header):
623 Function removed.
624 (grub_arch_dl_relocate_symbols): Likewise.
625 (grub_register_exported_symbols): Likewise.
626
4ceb3636 6272004-12-13 Marco Gerards <metgerards@student.han.nl>
628
629 * fs/ext2.c (grub_ext2_open): Don't use data after freeing it.
630 (grub_ext2_dir): Likewise. Don't return in case of an error, jump
631 to fail instead. Reported by Vincent Pelletier
632 <subdino2004@yahoo.fr>.
633
634 * fs/fshelp.c (grub_fshelp_find_file): Don't free `oldnode' when
635 it is not allocated. Reported by Vincent Pelletier
636 <subdino2004@yahoo.fr>.
637
638 * normal/cmdline.c (grub_tab_complete): Add a blank line to the
639 output so the output looks better.
640
3f1578fe 6412004-12-04 Marco Gerards <metgerards@student.han.nl>
642
643 Modulize the partition map support and add support for the amiga
644 partition map.
645
646 * commands/ls.c: Include <grub/partition.h> instead of
647 <grub/machine/partition.h>.
648 * kern/disk.c: Likewise.
649 * kern/rescue.c: Likewise.
650 * loader/i386/pc/chainloader.c: Likewise.
651 * normal/cmdline.c: Likewise.
652 * kern/powerpc/ieee1275/init.c: Likewise.
653 (grub_machine_init): Call `grub_pc_partition_map_init',
654 `grub_amiga_partition_map_init' and
655 `grub_apple_partition_map_init'.
656 * conf/i386-pc.rmk (kernel_img_SOURCES): Remove
657 `disk/i386/pc/partition.c'. Add `kern/partition.c'.
658 (kernel_img_HEADERS): Remove `machine/partition.h'. Add
659 `partition.h' and `pc_partition.h'.
660 (grub_setup_SOURCES): Remove
661 `disk/i386/pc/partition.c'. Add `kern/partition.c',
662 `partmap/amiga.c', `partmap/apple.c' and `partmap/pc.c'.
663 (grub_emu_SOURCES): Likewise.
664 (pkgdata_MODULES): Add `amiga.mod', `apple.mod' and `pc.mod'.
665 (amiga_mod_SOURCES, amiga_mod_CFLAGS, apple_mod_SOURCES)
666 (apple_mod_CFLAGS, pc_mod_SOURCES, pc_mod_CFLAGS): New variables.
667 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Remove
668 `disk/powerpc/ieee1275/partition.c'. Add `kern/partition.c',
669 `partmap/amiga.c', `partmap/apple.c' and `partmap/pc.c'.
670 (grubof_SOURCES): Likewise.
671 * disk/i386/pc/partition.c: File removed.
672 * disk/powerpc/ieee1275/partition.c: Likewise.
673 * include/grub/powerpc/ieee1275/partition.h: Likewise.
674 * include/grub/i386/pc/partition.h: Likewise.
675 * kern/partition.c: New file.
676 * partmap/amiga.c: Likewise.
677 * partmap/apple.c: Likewise.
678 * partmap/pc.c: Likewise.
679 * include/grub/partition.h: Likewise..
680 * include/grub/pc_partition.h: Likewise.
681 * util/grub-emu.c: Include <grub/partition.h> instead of
682 <grub/machine/partition.h>.
683 (main): Call `grub_pc_partition_map_init',
684 `grub_amiga_partition_map_init' and
685 `grub_apple_partition_map_init' and deinitialize afterwards.
686 * util/i386/pc/biosdisk.c: Include `#include
687 <grub/partition.h>' and `include <grub/pc_partition.h>' instead of
688 `<grub/machine/partition.h>'.
689 * util/i386/pc/grub-setup.c: Likewise.
690 * util/i386/pc/biosdisk.c: Likewise.
691 (grub_util_biosdisk_get_grub_dev): Only access the PC specific
692 partition information in case of a PC partition.
693 * util/i386/pc/grub-setup.c: Include `#include
694 <grub/partition.h>' and `include <grub/pc_partition.h>' instead of
695 `<grub/machine/partition.h>'.
696 (setup): Only access the PC specific partition information in case
697 of a PC partition.
698
0ef4ced9 6992004-11-17 Hollis Blanchard <hollis@penguinppc.org>
700
701 * kern/powerpc/ieee1275/init.c (grub_setjmp): Remove function.
702 (grub_longjmp): Likewise.
703 * include/grub/powerpc/setjmp.h (grub_jmp_buf): Set array size to
704 20.
705 * normal/powerpc/setjmp.S: New file.
706 * conf/powerpc-ieee1275.rmk (grubof_SOURCES): Add
707 `normal/powerpc/setjmp.S'.
708 (grubof_CFLAGS): Add `-DGRUBOF'.
709 * include/grub/setjmp.h [GRUB_UTIL]: Changed condition to
710 [GRUB_UTIL && !GRUBOF].
711
19950e29 7122004-11-16 Marco Gerards <metgerards@student.han.nl>
713
714 * kern/powerpc/ieee1275/openfw.c (grub_devalias_iterate): Skip any
715 property named `name'. Correctly handle the error returned by
716 `grub_ieee1275_finddevice' if a device can not be opened.
717
a2fea427 7182004-11-02 Hollis Blanchard <hollis@penguinppc.org>
719
720 * term/powerpc/ieee1275/ofconsole.c (grub_ofconsole_readkey): Test
721 `actual' for negativity.
722 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Remove
723 kern/fshelp.c.
724
41ea0ea3 7252004-11-01 Marco Gerards <metgerards@student.han.nl>
726
727 * term/i386/pc/vga.c (VGA_HEIGHT): Changed to 350.
728 (PAGE_OFFSET): New macro.
729 (CRTC_ADDR_PORT): Likewise.
730 (CRTC_DATA_PORT): Likewise.
731 (START_ADDR_HIGH_REGISTER): Likewise.
732 (START_ADDR_LOW_REGISTER): Likewise.
733 (GRAPHICS_ADDR_PORT): Likewise.
734 (GRAPHICS_DATA_PORT): Likewise.
735 (READ_MAP_REGISTER): Likewise.
736 (INPUT_STATUS1_REGISTER): Likewise.
737 (INPUT_STATUS1_VERTR_BIT): Likewise.
738 (page): New variable.
739 (wait_vretrace): New function.
740 (set_read_map): Likewise.
741 (set_start_address): Likewise.
742 (grub_vga_init): Use mode 0x10 instead of mode 0x12. Switch to
743 the right page.
744 (check_vga_mem): Take the page into account.
745 (write_char): Likewise.
746 (write_cursor): Likewise.
747 (scroll_up): Likewise. Copy the page to the page that is not
748 shown and switch between both pages.
749 (grub_vga_putchar): Fix off by one error.
750 (grub_vga_cls): Wait for the vertical retrace. Take the page into
751 account.
752
ad0bd20b 7532004-11-01 Marco Gerards <metgerards@student.han.nl>
754
755 Add support for iso9660 (including rockridge).
756
757 * conf/i386-pc.rmk (grub_emu_SOURCES): Add fs/iso9660.c.
758 (iso9660_mod_SOURCES): New variable.
759 (iso9660_mod_CFLAGS): Likewise.
760 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs/iso9660.c.
761 * include/grub/fs.h (grub_iso9660_init): New prototype.
762 * util/grub-emu.c (main): Call `grub_iso9660_init'.
763 * fs/iso9660.c: New file.
764
765 * include/grub/misc.h (grub_strncat): New prototype.
766 * kern/misc.c (grub_strncat): New function.
767
768 * fs/hfs.c (grub_hfs_mount): Translate the error
769 `GRUB_ERR_OUT_OF_RANGE' to `GRUB_ERR_BAD_FS'.
770 * fs/jfs.c (grub_jfs_mount): Likewise.
771 * fs/ufs.c (grub_ufs_mount): Likewise.
772
a5477a59 7732004-10-28 Hollis Blanchard <hollis@penguinppc.org>
774
775 * boot/powerpc/ieee1275/cmain.c (cmain): Remove asm statements
776 which initialized BAT registers.
777 * boot/powerpc/ieee1275/ieee1275.c (IEEE1275_CALL_ENTRY_FN,
778 grub_ieee1275_common_hdr, INIT_IEEE1275_COMMON):
779 Move from here...
780 * include/grub/powerpc/ieee1275/ieee1275.h (IEEE1275_CALL_ENTRY_FN,
781 grub_ieee1275_common_hdr, INIT_IEEE1275_COMMON):
782 ... to here.
783 * kern/powerpc/ieee1275/openfw.c (grub_map): New function.
784 (grub_mapclaim): Likewise.
785 * loader/powerpc/ieee1275/linux.c (grub_load_linux): Use
786 grub_mapclaim instead of grub_ieee1275_claim. Assign linux_addr by
787 hand.
788
9304c1f8 7892004-10-19 Hollis Blanchard <hollis@penguinppc.org>
790
791 * conf/powerpc-ieee1275.rmk (COMMON_ASFLAGS): Remove -fno-builtin.
792 (COMMON_CFLAGS): Remove -fno-builtin and -D__ASSEMBLY__. Add
793 -ffreestanding and -msoft-float.
794
86f4ae25 7952004-10-15 Hollis Blanchard <hollis@penguinppc.org>
796
797 * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_open): Do not
798 append ":0" to devpath if the GRUB_IEEE1275_NO_PARTITION_0 flag is
799 set in grub_ieee1275_flags.
800
38912228 8012004-10-14 Hollis Blanchard <hollis@penguinppc.org>
802
803 * include/grub/powerpc/ieee1275/ieee1275.h (abort): Add function
804 prototype.
805 * kern/powerpc/ieee1275/init.c (grub_machine_init): Call
806 grub_console_init first.
807 Change the memory range used for grub_ieee1275_claim and
808 grub_mm_init_region.
809 Print an error message if the claim fails.
810 Include <grub/misc.h>.
811
d1923dc8 8122004-10-13 Hollis Blanchard <hollis@penguinppc.org>
813
814 * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_iterate):
815 Call grub_children_iterate for device nodes of type `scsi',
816 `ide', or `ata'.
817 (grub_ofdisk_open): Remove manual device alias resolution.
818 Fix memory leak when device cannot be opened.
819 * include/grub/powerpc/ieee1275/ieee1275.h
820 (grub_children_iterate): New prototype.
821 * kern/powerpc/ieee1275/openfw.c (grub_children_iterate):
822 New function.
823 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_get_property):
824 Return -1 if args.size was -1.
825
4512e4f3 8262004-10-11 Hollis Blanchard <hollis@penguinppc.org>
827
828 * boot/powerpc/ieee1275/cmain.c (grub_ieee1275_flags): New global.
829 (cmain): Accept 3 parameters. Test for 0xdeadbeef, indicating Old
830 World Macintosh. If Old Wold, set flag in grub_ieee1275_flags; claim
831 Open Firmware's memory for it; claim memory from _start to _end.
832 * boot/powerpc/ieee1275/crt0.S (__bss_start): New extern.
833 (_end): New extern.
834 (_start): Zero BSS from __bss_start to _end.
835 * include/grub/powerpc/ieee1275/ieee1275.h (grub_ieee1275_flags):
836 New extern.
837 (GRUB_IEEE1275_NO_PARTITION_0): New #define.
838
4d61feb0 8392004-10-11 Hollis Blanchard <hollis@penguinppc.org>
840
ad0bd20b 841 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_claim): Return
842 -1 if args.base was -1.
4d61feb0 843
026fa2f9 8442004-10-08 Hollis Blanchard <hollis@penguinppc.org>
845
846 * term/powerpc/ieee1275/ieee1275.c (grub_ofconsole_cls): Use an ANSI
847 escape sequence instead of a literal ^L. Also call
848 grub_ofconsole_gotoxy.
849
9f2220ef 8502004-10-03 Hollis Blanchard <hollis@penguinppc.org>
851
852 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_claim): change
853 void * arguments to grub_addr_t. All callers updated. Also make
854 the `result' argument optional.
855 (grub_ieee1275_release): change void * arguments to grub_addr_t.
856 All callers updated.
857
8a572cd7 8582004-09-22 Hollis Blanchard <hollis@penguinppc.org>
859
860 * commands/ls.c (grub_ls_list_files): Use the string following the
861 initial ')', if present, as the filesystem path.
862 * kern/rescue.c (grub_rescue_cmd_ls): Likewise.
863
864 * conf/powerpc-ieee1275.rmk (grubof_SOURCES): List crt0.S first.
865
18aa81f2 8662004-09-18 Yoshinori K. Okuji <okuji@enbug.org>
867
868 Make the source code of the menu interface more readable.
869
870 * normal/menu.c: Include grub/mm.h.
871 (TERM_WIDTH): New macro.
872 (TERM_HEIGHT): Likewise.
873 (TERM_INFO_HEIGHT): Likewise.
874 (TERM_MARGIN): Likewise.
875 (TERM_SCROLL_WIDTH): Likewise.
876 (TERM_TOP_BORDER_Y): Likewise.
877 (TERM_LEFT_BORDER_X): Likewise.
878 (TERM_BORDER_WIDTH): Likewise.
879 (TERM_MESSAGE_HEIGHT): Likewise.
880 (TERM_BORDER_HEIGHT): Likewise.
881 (TERM_NUM_ENTRIES): Likewise.
882 (TERM_FIRST_ENTRY_Y): Likewise.
883 (TERM_ENTRY_WIDTH): Likewise.
884 (TERM_CURSOR_X): Likewise.
885 (draw_border): Use macros instead of magic numbers.
886 (print_entry): Likewise.
887 (print_entries): Likewise.
888 (run_menu): Likewise. Also, handle the key 'e'.
889 (run_menu_entry): Ignore empty command lines.
890 (print_message): Added a new argument EDIT. If EDIT is true,
891 print a different message.
892 (init_page): Likewise.
893 (edit_menu_entry): New function. Not implemented yet.
894
b47efe30 8952004-09-17 Marco Gerards <metgerards@student.han.nl>
896
897 Add `linux.mod' and `multiboot.mod' so linux and multiboot kernels
898 can be loaded from normal mode.
899
900 * conf/i386-pc.rmk (pkgdata_MODULES): Add `linux.mod' and
901 `multiboot.mod'.
902 (linux_mod_SOURCES, linux_mod_CFLAGS, multiboot_mod_SOURCES)
903 (multiboot_mod_CFLAGS): New variables.
904 * loader/i386/pc/linux_normal.c: New file.
905 * loader/i386/pc/multiboot_normal.c: Likewise.
906
907 * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Don't use the
908 attribute `unused'.
909
910 * fs/ext2.c (grub_ext2_iterate_dir): Fix typos in inode type. Use
911 `fdiro' to read the mode information from instead of `diro'.
912
913 * fs/fshelp.c (grub_fshelp_find_file): Set type to foundtype after
914 looking up a symlink.
915
916 * include/grub/normal.h (GRUB_COMMAND_FLAG_NO_ARG_PARSE): New
917 macro.
918 * normal/command.c (grub_command_execute): Don't parse the
919 arguments when `GRUB_COMMAND_FLAG_NO_ARG_PARSE' is set in the
920 flags of the command.
921
922 * normal/menu.c (grub_menu_run): Fix typo.
923
da75ac71 9242004-09-14 Hollis Blanchard <hollis@penguinppc.org>
925
926 * kern/powerpc/ieee1275/init.c (abort): Trap into Open Firmware.
927
928 * term/powerpc/ieee1275/ofconsole.c (grub_ofconsole_gotoxy): Use
929 `y + 1' instead of `y - 1'.
930
931 * conf/powerpc-ieee1275.rmk (grubof_LDFLAGS): Add `-N' and `-S'.
932
062b24c2 9332004-09-14 Yoshinori K. Okuji <okuji@enbug.org>
934
935 From Hollis Blanchard <hollis@penguinppc.org>:
936 * kern/misc.c (memmove): New alias for grub_memmove.
937 (memcmp): New alias for grub_memcmp.
938 (memset): New alias for grub_memset.
939 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_get_property):
940 Change "int handle" to "grub_ieee1275_phandle_t handle".
941 * include/grub/powerpc/ieee1275/ieee1275.h
942 (grub_ieee1275_get_property): Likewise.
943
8ddad845 9442004-09-12 Tomas Ebenlendr <ebik@ucw.cz>
945
946 Added normal mode command `chainloader' as module chain.mod, which
947 depends on normal.mod and _chain.mod.
948
949 * conf/i386-pc.rmk (pkgdata_MODULES): Add `chain.mod'.
950 (chain_mod_SOURCES, chain_mod_CFLAGS): Variables added.
951 * include/grub/i386/pc/loader.h (grub_rescue_cmd_chainloader):
952 Deleted prototype.
953 * loader/i386/pc/chainloader.c (grub_rescue_cmd_chainloader): All
954 but arguments parsing moved to ...
955 (grub_chainloader_cmd): ... here. New function.
956 * include/grub/i386/pc/chainloader.h: New file.
957 * loader/i386/pc/chainloader_normal.c: Likewise.
958
2c1f4ce3 9592004-09-11 Marco Gerards <metgerards@student.han.nl>
960
961 * conf/i386-pc.rmk (kernel_img_SOURCES): Added kern/fshelp.c.
962 (grub_mkimage_LDFLAGS): Likewise.
963 (grub_emu_SOURCES): Likewise.
964 (kernel_img_HEADERS): Added fshelp.h.
965 * fs/ext2.c: Include <grub/fshelp.h>.
966 (FILETYPE_REG): New macro.
967 (FILETYPE_INO_REG): Likewise.
968 (grub_ext_sblock): Renamed to `grub_ext2_sblock'.
969 Changed all users.
970 (ext2_block_group): Renamed to `grub_ext2_block_group'. Changed
971 all users.
972 (grub_fshelp_node): New struct.
973 (grub_ext2_data): Added member `diropen'. Changed member `inode'
974 to a pointer.
975 (grub_ext2_get_file_block): Removed function.
976 (grub_ext2_read_block): New function.
977 (grub_ext2_read_file): Replaced parameter `data' by `node'.
978 This function was written.
979 (grub_ext2_mount): Read the root inode. Create a diropen struct.
980 (grub_ext2_find_file): Removed function.
981 (grub_ext2_read_symlink): New function.
982 (grub_ext2_iterate_dir): Likewise.
983 (grub_ext2_open): Rewritten.
984 (grub_ext2_dir): Rewritten.
985 * include/grub/fshelp.h: New file.
986 * fs/fshelp.c: Likewise.
987
3c52136a 9882004-09-10 Yoshinori K. Okuji <okuji@enbug.org>
989
990 * normal/menu.c: Include grub/loader.h and grub/machine/time.h.
991 (print_message): Add a missing newline.
992 (run_menu): Added timeout support.
993 (run_menu_entry): New local function.
994 (grub_menu_run): Added support for booting.
995
996 * kern/loader.c (grub_loader_is_loaded): New function.
997
998 * include/grub/powerpc/ieee1275/time.h: Include grub/symbol.h.
999 (grub_get_rtc): Exported.
1000
1001 * include/grub/i386/pc/time.h: Include grub/symbol.h.
1002 (grub_get_rtc): Exported.
1003
1004 * include/grub/normal.h (struct grub_command_list): Remove
1005 constant from the member `command'.
1006
1007 * include/grub/loader.h (grub_loader_is_loaded): Declared.
1008
1009 * include/grub/err.h (GRUB_ERR_INVALID_COMMAND): New constant.
1010
1011 * conf/i386-pc.rmk (kernel_img_HEADERS): Added machine/time.h.
1012
aa033560 10132004-08-28 Marco Gerards <metgerards@student.han.nl>
1014
1015 Add support for the JFS filesystem.
1016
1017 * fs/jfs.c: New file.
1018 * include/grub/fs.h (grub_jfs_init): New prototype.
1019 (grub_jfs_fini): New prototype.
1020 * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/jfs.c.
1021 (grub_emu_SOURCES): Likewise.
1022 (pkgdata_MODULES): Add jfs.mod.
1023 (jfs_mod_SOURCES): New variable.
1024 (jfs_mod_CFLAGS): Likewise.
1025 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs.jfs.c.
1026 (grubof_SOURCES): Likewise.
1027 * util/grub-emu.c (main): Initialize and deinitialize JFS support.
1028
1029 * fs/fat.c (grub_fat_find_dir): Convert the filename little
1030 endian to the host endian.
1031 (grub_fat_utf16_to_utf8): Move function from there...
1032 * kern/misc.c (grub_utf16_to_utf8): ...to here. Do not convert
1033 the endianess of the source string anymore.
1034 * include/grub/misc.h (grub_utf16_to_utf8): New prototype.
1035
94bc45af 10362004-08-24 Marco Gerards <metgerards@student.han.nl>
1037
1038 * commands/boot.c (grub_boot_init) [GRUB_UTIL]: Make conditional.
1039 (grub_boot_fini) [GRUB_UTIL]: Likewise.
1040 (GRUB_MOD_INIT) [!GRUB_UTIL]: Likewise.
1041 (GRUB_MOD_FINI) [!GRUB_UTIL]: Likewise.
1042
1043 * fs/hfs.c (grub_hfs_find_node): Add a prototype for `node_found'.
1044 (grub_hfs_iterate_dir): Make the function static. Add prototypes
1045 for `node_found' and `it_dir'.
1046 (grub_hfs_dir): Add prototype for `dir_hook'.
1047
1048 * fs/minix.c (grub_minix_get_file_block): Add prototype for
1049 `grub_get_indir'. Rename `indir' in two blocks to `indir16'
1050 and `indir32' to silence a gcc warning.
1051
1052 * include/grub/fs.h (grub_hfs_init): New prototype.
1053 (grub_hfs_fini): Likewise.
1054
1055
97543f08 10562004-08-21 Yoshinori K. Okuji <okuji@enbug.org>
1057
1058 Each disk device has its own id now. This is useful to make use
1059 of multiple disk devices.
1060
1061 * include/grub/disk.h (grub_disk_dev_id): New enum.
1062 (GRUB_DISK_DEVICE_BIOSDISK_ID): New constant.
1063 (GRUB_DISK_DEVICE_OFDISK_ID): Likewise.
1064
1065 * disk/i386/pc/biosdisk.c (grub_biosdisk_dev): Specify
1066 GRUB_DISK_DEVICE_BIOSDISK_ID as an id.
1067
1068 * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_dev): Specify
1069 GRUB_DISK_DEVICE_OFDISK_ID as an id.
1070
1071 * util/i386/pc/biosdisk.c (grub_util_biosdisk_dev): Specify
1072 GRUB_DISK_DEVICE_BIOSDISK_ID as an id.
1073
1074 * include/grub/disk.h (struct grub_disk_dev): Added a new member
1075 "id" which is used by the cache manager.
1076
1077 * normal/main.c (grub_normal_init_page): Use "GNU GRUB" instead
1078 of just "GRUB".
1079
64372eb4 10802004-08-18 Marco Gerards <metgerards@student.han.nl>
1081
1082 * fs/hfs.c: New file.
1083 * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/hfs.c.
1084 (grub_emu_SOURCES): Likewise.
1085 (pkgdata_MODULES): Add hfs.mod.
1086 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs/hfs.c.
1087 (grubof_SOURCES): Likewise.
1088 * util/grub-emu.c (main): Initialize and deinitialize HFS support.
1089
1090 * include/grub/misc.h (grub_strncasecmp): Add prototype.
1091 * kern/misc.c (grub_strncasecmp): Add function.
1092
cc61b58f 10932004-08-14 Marco Gerards <metgerards@student.han.nl>
1094
1095 * include/grub/arg.h (GRUB_ARG_OPTION_OPTIONAL): Surround macro
1096 with parentheses.
1097
1098 * fs/ext2.c (FILETYPE_UNKNOWN): New macro.
1099 (grub_ext2_dir): In case the directory entry type is unknown, read
1100 it from the inode.
1101
0ef123f6 11022004-08-02 Peter Bruin <pjbruin@dds.nl>
1103
1104 * loader/powerpc/ieee1275/linux.c (grub_linux_init): Pass
1105 grub_load_linux instead of grub_rescue_cmd_linux as second
1106 argument of grub_rescue_register_command.
1107
1108 * Makefile.in (RMKFILES): Add conf/powerpc-ieee1275.rmk.
1109
a447c5df 11102004-07-27 Marco Gerards <metgerards@student.han.nl>
1111
1112 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_release): New
1113 function.
1114 * commands/boot.c: Remove the check for `GRUB_UTIL'.
1115 * conf/powerpc-ieee1275.rmk (grubof_SOURCES): Add
1116 `loader/powerpc/ieee1275/linux.c',
1117 `loader/powerpc/ieee1275/linux_normal.c' and `commands/boot.c'.
1118 * include/grub/powerpc/ieee1275/ieee1275.h
1119 (grub_ieee1275_release): New prototype.
1120 * include/grub/powerpc/ieee1275/loader.h: Rewritten.
1121 * kern/powerpc/ieee1275/init.c (grub_machine_init): Initialize
1122 normal, boot, linux and linux_normal.
1123 * loader/powerpc/ieee1275/linux.c: New file.
1124 * loader/powerpc/ieee1275/linux_normal.c: Likewise.
1125
5a9e3546 11262004-07-12 Marco Gerards <metgerards@student.han.nl>
1127
1128 * normal/arg.c (grub_arg_parse): Correct error handling after
1129 reallocating the argumentlist (check if `argl' is not null instead
1130 of checking if `args' is not null).
1131 * kern/mm.c (grub_realloc): Return the same pointer when using the
1132 same region, instead of returning the header address.
1133
e15199cb 11342004-07-11 Marco Gerards <metgerards@student.han.nl>
1135
1136 * disk/powerpc/ieee1275/partition.c (grub_partition_iterate): Skip
1137 one block instead of two when looking for the initial partition.
1138 (grub_partition_probe): Initialize the local variable `p' with 0.
1139 Use base 10 for the grub_strtoul call.
1140 * kern/misc.c (grub_strncpy): Fix off by one bug. Eliminated the
1141 need for one local variable.
1142 (grub_strtoul): Don't add the new value to `num', instead of that
1143 just assign it.
1144
020616c2 11452004-07-11 Marco Gerards <metgerards@student.han.nl>
1146
1147 * conf/i386-pc.rmk (pkgdata_IMAGE): Add pxeboot.img.
1148 (pxeboot_img_SOURCES): New variable.
1149 (pxeboot_img_ASFLAGS): Likewise.
1150 (pxeboot_img_LDFLAGS): Likewise.
1151 * boot/i386/pc/pxeboot.S: New file. Based on pxeloader.S from
1152 GRUB Legacy and boot.S. Adopted for GRUB 2 by lode leroy
1153 <lode_leroy@hotmail.com>.
1154
6c51eb64 11552004-06-27 Tomas Ebenlendr <ebik@ucw.cz>
1156
1157 * kern/rescue.c (grub_enter_rescue_mode): Don't continue when
1158 there was no input.
1159
cfb12aff 11602004-06-27 Tomas Ebenlendr <ebik@ucw.cz>
1161
1162 * normal/cmdline.c (grub_set_history): Fix off by one bug. Fixed
1163 the history buffer logic.
1164
6eabba74 11652004-06-27 Tomas Ebenlendr <ebik@ucw.cz>
1166
1167 * fs/ext2.c (FILETYPE_INO_MASK, FILETYPE_INO_DIRECTORY)
1168 (FILETYPE_INO_SYMLINK): New macros.
1169 (grub_ext2_find_file): Check if the node is a directory using the
1170 inode stat information instead of using the filetype in the
1171 dirent. Exclude the first character of an absolute symlink.
1172 (grub_ext2_dir): Mask out the filetype part of the mode member of
1173 the inode.
1174
66e19ef8 11752004-05-24 Marco Gerards <metgerards@student.han.nl>
1176
1177 Add support for UFS version 1 and 2. Add support for the minix
1178 filesystem version 1 and 2, both the variants with 14 and 30 long
1179 filenames.
1180
1181 * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/ufs.c and
1182 fs/minix.c.
1183 (grub_emu_SOURCES): Likewise.
1184 (pkgdata_MODULES): Add ufs.mod and minix.mod.
1185 (ufs_mod_SOURCES): New variable.
1186 (ufs_mod_CFLAGS): Likewise.
1187 (minix_mod_SOURCES): Likewise.
1188 (minix_mod_CFLAGS): Likewise.
1189 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs/ufs.c and
1190 fs/minix.c.
1191 (grubof_SOURCES): Likewise.
1192 * fs/ufs.c: New file.
1193 * fs/minix.c: New file.
1194 * include/grub/fs.h (grub_ufs_init): New prototype.
1195 (grub_ufs_fini): Likewise.
1196 (grub_minix_init): Likewise.
1197 (grub_minix_fini): Likewise.
1198 * util/grub-emu.c (main): Initialize and deinitialize UFS and
1199 minix fs.
1200
cc2e748a 12012004-04-30 Jeroen Dekkers <jeroen@dekkers.cx>
1202
1203 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add normal/arg.c,
1204 commands/ls.c, commands/terminal.c, commands/boot.c,
1205 commands/cmp.c and commands/cat.c.
1206 (grubof_LDFLAGS): Add -nostdlib -static-libgcc -lgcc.
1207
1208 * kern/powerpc/ieee1275/init.c: Include "grub/env.h" instead of
1209 "env.h"
1210
4b13b216 12112004-04-04 Yoshinori K. Okuji <okuji@enbug.org>
1212
1213 All symbols prefixed with PUPA_ and pupa_ are renamed to GRUB_
1214 and grub_, respectively. Because the conversion is trivial and
1215 mechanical, I omit the details here. Please refer to the CVS
1216 if you need more information.
1217
6a142551 12182004-04-04 Yoshinori K. Okuji <okuji@enbug.org>
1219
1220 * include/pupa: Renamed to ...
1221 * include/grub: ... this.
1222 * util/i386/pc/pupa-mkimage.c: Renamed to ...
1223 * util/i386/pc/grub-mkimage.c: ... this.
1224 * util/i386/pc/pupa-setup.c: Renamed to ...
1225 * util/i386/pc/grub-setup.c: ... this.
1226 * util/pupa-emu.c: Renamed to ...
1227 * util/grub-emu.c: ... this.
1228
e56cdf21 12292004-03-29 Marco Gerards <metgerards@student.han.nl>
1230
1231 Add support for the newworld apple macintosh (PPC). This has been
1232 tested on the powerbook 2000 only. It only adds support for
1233 generic ieee1275 functions, console and disk support. This should
1234 be easy to port to other architectures with support for Open
1235 Firmware.
1236
1237 * configure.ac: Accept the powerpc as host_cpu. In the case of
1238 the powerpc cpu set the host_vendor to ieee1275. Make sure the i386
1239 specific tests are only executed while building for the i386.
1240 Inverse test for crosscompile.
1241 * genmk.rb (Utility): Allow assembler files.
1242 * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno.
1243 * conf/powerpc-ieee1275.rmk: New file.
1244 * disk/powerpc/ieee1275/ofdisk.c: Likewise.
1245 * disk/powerpc/ieee1275/partition.c: Likewise.
1246 * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise.
1247 * include/pupa/powerpc/ieee1275/console.h: Likewise.
1248 * include/pupa/powerpc/ieee1275/partition.h: Likewise.
1249 * include/pupa/powerpc/ieee1275/time.h: Likewise.
1250 * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise.
1251 * include/pupa/powerpc/ieee1275/multiboot.h: Likewise.
1252 * include/pupa/powerpc/ieee1275/loader.h
1253 * include/pupa/powerpc/setjmp.h: Likewise.
1254 * include/pupa/powerpc/types.h: Likewise.
1255 * kern/powerpc/ieee1275/init.c: Likewise.
1256 * kern/powerpc/ieee1275/openfw.c: Likewise.
1257 * term/powerpc/ieee1275/ofconsole.c: Likewise.
1258
1259 These files were written by Johan Rydberg
1260 (jrydberg@night.trouble.net) and I only modified them slightly.
1261
1262 * boot/powerpc/ieee1275/cmain.c: New file.
1263 * boot/powerpc/ieee1275/crt0.S: Likewise.
1264 * boot/powerpc/ieee1275/ieee1275.c: Likewise.
1265 * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
1266
8c8cc205 12672004-03-14 Jeroen Dekkers <jeroen@dekkers.cx>
1268
1269 * Makefile.in: Update copyright.
1270 * genmodsrc.sh: Likewise.
1271 * gensymlist.sh: Likewise.
1272 * term/i386/pc/vga.c: Indent correctly.
1273
1274 * util/i386/pc/pupa-mkimage.c (usage): Use PACKAGE_BUGREPORT as
1275 bugreporting address.
1276 * util/i386/pc/pupa-setup.c (usage): Likewise,
1277 (main): Call pupa_ext2_init and pupa_ext2_fini.
1278
1279 * fs/fat.c (log2): Renamed to ...
1280 (fat_log2): ... this.
1281 All callers changed.
1282 * kern/misc.c (memcpy): Alias to pupa_memmove.
1283 * loader/i386/pc/multiboot.c (pupa_rescue_cmd_multiboot): Fix
1284 lvalue cast.
1285 * util/console.c (pupa_ncurses_fini): Return 0.
1286
1287 * util/i386/pc/biosdisk.c (pupa_util_biosdisk_open)[__linux__]:
1288 Move fail label here.
1289 [__GNU__]: Don't warn when using stat.
1290 (open_device)[!__linux__]: Check if FD < 0 instead of !FD.
1291 (pupa_util_biosdisk_get_pupa_dev)[__GNU__]: Change type of N to
1292 long int. Use strtol instead of strtoul.
1293
db1771cf 12942004-03-14 Marco Gerards <metgerards@student.han.nl>
1295
1296 * commands/boot.c: New file.
1297 * commands/cat.c: Likewise.
1298 * commands/cmp.c: Likewise.
1299 * commands/ls.c: Likewise.
1300 * commands/terminal.c: Likewise.
1301 * normal/command.c: Include <pupa/env.h> and <pupa/dl.h>.
1302 (pupa_register_command): Changed interface to match the new
1303 argument parser.
1304 (pupa_command_execute): Changed (almost rewritten) so it uses
1305 pupa_split_command. Added support for setting variables using the
1306 syntax `foo=bar'.
1307 (rescue_command): Changed to work with the new argument parser.
1308 (terminal_command): Moved from here to commands/terminal.c.
1309 (set_command): New function.
1310 (unset_command): New function.
1311 (insmod_command): New function.
1312 (rmmod_command): New function.
1313 (lsmod_command): New function.
1314 (pupa_command_init): Don't initialize the command terminal
1315 anymore. Initialize the commands set, unset, insmod, rmmod and
1316 lsmod.
1317 * conf/i386-pc.rmk (kernel_img_SOURCES): Add kern/env.c.
1318 (kernel_img_HEADERS): Add arg.h and env.h.
1319 (pupa_mkimage_LDFLAGS): Add kern/env.c.
1320 (pupa_emu_SOURCES): Add kern/env.c, commands/ls.c,
1321 commands/terminal.c commands/boot.c commands/cmp.c commands/cat.c,
1322 normal/arg.c.
1323 (pkgdata_MODULES): Add ls.mod, boot.mod, cmp.mod, cat.mod and
1324 terminal.mod.
1325 (normal_mod_SOURCES): Add normal/arg.c and normal/arg.c.
1326 (boot_mod_SOURCES): New variable.
1327 (terminal_mod_SOURCES): Likewise.
1328 (ls_mod_SOURCES): Likewise.
1329 (cmp_mod_SOURCES): Likewise.
1330 (cat_mod_SOURCES): Likewise.
1331
1332 * normal/arg.c: New file.
1333 * kern/env.c: Likewise.
1334 * include/pupa/arg.h: Likewise.
1335 * include/pupa/env.h: Likewise.
1336 * font/manager.c (font_command): Changed to match argument parsing
1337 interface changes.
1338 (PUPA_MOD_INIT): Likewise.
1339 * hello/hello.c (pupa_cmd_hello): Likewise.
1340 (PUPA_MOD_INIT): Likewise.
1341 * include/pupa/disk.h: Include <pupa/device.h>.
1342 (pupa_print_partinfo): New prototype.
1343 * include/pupa/dl.h (pupa_dl_set_prefix): Prototype removed.
1344 (pupa_dl_get_prefix): Likewise.
1345 * include/pupa/misc.h: Include <pupa/err.h>.
1346 (pupa_isgraph): New prototype.
1347 (pupa_isdigit): Likewise.
1348 (pupa_split_cmdline): Likewise.
1349 * include/pupa/normal.h: Include <pupa/arg.h>.
1350 (pupa_command): Changed the prototype of the member `func' to
1351 match the argument parsing interface. Added member `options'.
1352 (pupa_register_command): Updated to match function.
1353 (pupa_arg_parse): New prototype.
1354 (pupa_hello_init) [PUPA_UTIL]: New prototype.
1355 (pupa_hello_fini) [PUPA_UTIL]: Likewise.
1356 (pupa_ls_init) [PUPA_UTIL]: Likewise.
1357 (pupa_ls_fini) [PUPA_UTIL]: Likewise.
1358 (pupa_cat_init) [PUPA_UTIL]: Likewise.
1359 (pupa_cat_fini) [PUPA_UTIL]: Likewise.
1360 (pupa_boot_init) [PUPA_UTIL]: Likewise.
1361 (pupa_boot_fini) [PUPA_UTIL]: Likewise.
1362 (pupa_cmp_init) [PUPA_UTIL]: Likewise.
1363 (pupa_cmp_fini) [PUPA_UTIL]: Likewise.
1364 (pupa_terminal_init) [PUPA_UTIL]: Likewise.
1365 (pupa_terminal_fini) [PUPA_UTIL]: Likewise.
1366 * kern/disk.c: Include <pupa/file.h>.
1367 (pupa_print_partinfo): New function.
1368 * kern/dl.c: Include <pupa/env.h>.
1369 (pupa_dl_dir): Variable removed.
1370 (pupa_dl_load): Use the environment variable `prefix' instead of
1371 the variable pupa_dl_dir.
1372 (pupa_dl_set_prefix): Function removed.
1373 (pupa_dl_get_prefix): Likewise.
1374 * kern/i386/pc/init.c: Include <pupa/env.h>.
1375 (pupa_machine_init): Use the environment variable `prefix' instead of
1376 using pupa_dl_set_prefix to set the prefix.
1377 * kern/main.c: Include <pupa/env.h>.
1378 (pupa_set_root_dev): Use the environment variable `prefix' instead of
1379 using pupa_dl_get_prefix to get the prefix.
1380 * kern/misc.c: Include <pupa/env.h>.
1381 (pupa_isdigit): New function.
1382 (pupa_isgraph): Likewise.
1383 (pupa_ftoa): Likewise.
1384 (pupa_vsprintf): Added support for printing values of the type
1385 `double'. Make it possible to format variable output when using
1386 formatting like `%1.2%f'.
1387 (pupa_split_cmdline): New function.
1388 * kern/rescue.c: Include <pupa/env.h>.
1389 (next_word): Removed function.
1390 (pupa_rescue_cmd_prefix): Likewise.
1391 (pupa_rescue_cmd_set): New function.
1392 (pupa_rescue_cmd_unset): New function.
1393 (pupa_enter_rescue_mode): Use the `pupa_split_cmdline' function to
1394 split the command line instead of splitting it here. Added
1395 support for setting variables using the syntax `foo=bar'. Don't
1396 initialize the prefix command anymore. Initialized the set and
1397 unset commands.
1398 * normal/cmdline.c: Include <pupa/env.h>.
1399 (pupa_tab_complete): Added prototypes for print_simple_completion,
1400 print_partition_completion, add_completion, iterate_commands,
1401 iterate_dev, iterate_part and iterate_dir. Moved code to print
1402 partition information from here to kern/disk.c.
1403 (pupa_cmdline_run): Don't check if the funtion exists anymore.
1404 * normal/main.c: Include <pupa/env.h>.
1405 (pupa_rescue_cmd_normal): Use the environment variable `prefix'
1406 instead of using pupa_dl_get_prefix to get the prefix.
1407 * term/i386/pc/vga.c: Include <pupa/arg.h>.
1408 (check_vga_mem): Cast pointers to `void *' to silence a gcc
1409 warning.
1410 (pupa_vga_putchar) [! DEBUG_VGA]: Removed for this case.
1411 (pupa_vga_setcolor): Declare unused variables with `__attribute__
1412 ((unused))' to silence a gcc warning.
1413 (pupa_vga_setcolor): Likewise.
1414 (debug_command): Changed to match argument parsing
1415 interface changes.
1416 * util/pupa-emu.c: Include <pupa/env.h>.
1417 (options): Added 0's for unused fields to silence a gcc warning.
1418 (argp): Likewise.
1419 (main): Use the environment variable `prefix' instead of using
1420 pupa_dl_set_prefix to set the prefix. Initialize the commands ls,
1421 boot, cmp, cat and terminal. Finish the commands boot, cmp, cat
1422 and terminal.
1423
1424 * util/i386/pc/getroot.c: Include <pupa/i386/pc/util/biosdisk.h>.
1425 * util/misc.c: Include <malloc.h>.
1426 (pupa_malloc): Rewritten so errors are correctly reported.
1427 (pupa_realloc): Likewise.
1428 (pupa_memalign): Likewise.
1429 (pupa_mm_init_region): Declare unused variables with
1430 `__attribute__ ((unused))' to silence a gcc warning.
1431 * normal/i386/setjmp.S: Remove tab at the end of the file to
1432 silence a gcc warning.
1433 * loader/i386/pc/linux.c (pupa_rescue_cmd_initrd): Declare unused
1434 variables with `__attribute__ ((unused))' to silence a gcc
1435 warning.
1436 * loader/i386/pc/multiboot.c (pupa_multiboot_unload): Make the
1437 local variable i unsigned to silence a gcc warning.
1438
1439 * kern/term.c: Include <pupa/misc.h>.
1440 (pupa_more_lines): New variable.
1441 (pupa_more): Likewise.
1442 (pupa_putcode): When the pager is active pause at the end of every
1443 screen.
1444 (pupa_set_more): New function.
1445 * include/pupa/term.h (pupa_set_more): New prototype.
1446
1447
3b1139cb 14482004-03-07 Yoshinori K. Okuji <okuji@enbug.org>
1449
1450 Now this project is GRUB 2 rather than PUPA. The location of
1451 the CVS repository was moved to GRUB's.
1452
1453 * configure.ac: Use bug-grub as the reporting address.
1454 Use GRUB instead of PUPA.
1455 Change the version number to 1.90.
1456
8367695c 14572004-02-24 Yoshinori K. Okuji <okuji@enbug.org>
1458
1459 * genkernsyms.sh: Updated copyright information.
1460 * genmk.rb: Likewise.
1461 * genmodsrc.sh: Likewise.
1462 * gensymlist.sh: Likewise.
1463 * boot/i386/pc/boot.S: Likewise.
1464 * boot/i386/pc/diskboot.S: Likewise.
1465 * disk/i386/pc/biosdisk.c: Likewise.
1466 * disk/i386/pc/partition.c: Likewise.
1467 * font/manager.c: Likewise.
1468 * fs/ext2.c: Likewise.
1469 * fs/fat.c: Likewise.
1470 * include/pupa/boot.h: Likewise.
1471 * include/pupa/device.h: Likewise.
1472 * include/pupa/disk.h: Likewise.
1473 * include/pupa/dl.h: Likewise.
1474 * include/pupa/elf.h: Likewise.
1475 * include/pupa/err.h: Likewise.
1476 * include/pupa/file.h: Likewise.
1477 * include/pupa/font.h: Likewise.
1478 * include/pupa/fs.h: Likewise.
1479 * include/pupa/kernel.h: Likewise.
1480 * include/pupa/loader.h: Likewise.
1481 * include/pupa/misc.h: Likewise.
1482 * include/pupa/mm.h: Likewise.
1483 * include/pupa/net.h: Likewise.
1484 * include/pupa/normal.h: Likewise.
1485 * include/pupa/rescue.h: Likewise.
1486 * include/pupa/setjmp.h: Likewise.
1487 * include/pupa/symbol.h: Likewise.
1488 * include/pupa/term.h: Likewise.
1489 * include/pupa/types.h: Likewise.
1490 * include/pupa/i386/setjmp.h: Likewise.
1491 * include/pupa/i386/types.h: Likewise.
1492 * include/pupa/i386/pc/biosdisk.h: Likewise.
1493 * include/pupa/i386/pc/boot.h: Likewise.
1494 * include/pupa/i386/pc/console.h: Likewise.
1495 * include/pupa/i386/pc/init.h: Likewise.
1496 * include/pupa/i386/pc/kernel.h: Likewise.
1497 * include/pupa/i386/pc/linux.h: Likewise.
1498 * include/pupa/i386/pc/loader.h: Likewise.
1499 * include/pupa/i386/pc/memory.h: Likewise.
1500 * include/pupa/i386/pc/multiboot.h: Likewise.
1501 * include/pupa/i386/pc/partition.h: Likewise.
1502 * include/pupa/i386/pc/time.h: Likewise.
1503 * include/pupa/i386/pc/vga.h: Likewise.
1504 * include/pupa/i386/pc/util/biosdisk.h: Likewise.
1505 * include/pupa/util/getroot.h: Likewise.
1506 * include/pupa/util/misc.h: Likewise.
1507 * include/pupa/util/resolve.h: Likewise.
1508 * kern/device.c: Likewise.
1509 * kern/disk.c: Likewise.
1510 * kern/dl.c: Likewise.
1511 * kern/err.c: Likewise.
1512 * kern/file.c: Likewise.
1513 * kern/fs.c: Likewise.
1514 * kern/loader.c: Likewise.
1515 * kern/main.c: Likewise.
1516 * kern/misc.c: Likewise.
1517 * kern/mm.c: Likewise.
1518 * kern/rescue.c: Likewise.
1519 * kern/term.c: Likewise.
1520 * kern/i386/dl.c: Likewise.
1521 * kern/i386/pc/init.c: Likewise.
1522 * kern/i386/pc/lzo1x.S: Likewise.
1523 * kern/i386/pc/startup.S: Likewise.
1524 * loader/i386/pc/chainloader.c: Likewise.
1525 * loader/i386/pc/linux.c: Likewise.
1526 * loader/i386/pc/multiboot.c: Likewise.
1527 * normal/cmdline.c: Likewise.
1528 * normal/command.c: Likewise.
1529 * normal/main.c: Likewise.
1530 * normal/menu.c: Likewise.
1531 * normal/i386/setjmp.S: Likewise.
1532 * term/i386/pc/console.c: Likewise.
1533 * term/i386/pc/vga.c: Likewise.
1534 * util/console.c: Likewise.
1535 * util/genmoddep.c: Likewise.
1536 * util/misc.c: Likewise.
1537 * util/pupa-emu.c: Likewise.
1538 * util/resolve.c: Likewise.
1539 * util/unifont2pff.rb: Likewise.
1540 * util/i386/pc/biosdisk.c: Likewise.
1541 * util/i386/pc/getroot.c: Likewise.
1542 * util/i386/pc/pupa-mkimage.c: Likewise.
1543 * util/i386/pc/pupa-setup.c: Likewise.
1544
e6eced71 15452004-02-15 Jeroen Dekkers <jeroen@dekkers.cx>
1546
1547 * fs/ext2.c (pupa_ext2_read_file): Correct the value of BLOCKEND
1548 when it is EXT2_BLOCK_SIZE (data). New argument READ_HOOK, all
1549 callers changed. Set DATA->DISK->READ_HOOK to READ_HOOK before
1550 reading and reset it after reading.
1551 (pupa_ext2_close): Return PUPA_ERR_NONE.
1552
1553 * include/pupa/i386/pc/linux.h (PUPA_LINUX_INITRD_MAX_ADDRESS):
1554 Correct value.
1555 (struct linux_kernel_header): Add kernel_version and
1556 initrd_addr_max.
1557 * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Check whether
1558 pupa_file_read succeeds.
1559 (pupa_rescue_cmd_initrd): Implement.
1560
5aded270 15612003-12-03 Marco Gerards <metgerards@student.han.nl>
1562
1563 * fs/ext2.c (pupa_ext2_label): New function.
1564 (pupa_ext2_fs): Added label.
1565 * fs/fat.c (pupa_fat_label): New function.
1566 (pupa_fat_fs): Added label.
1567 * include/pupa/fs.h (struct pupa_fs): Added prototype label.
1568
1569 * kern/misc.c (pupa_strndup): New function.
1570 * include/pupa/misc.h (pupa_strndup): New prototype.
1571
1572 * include/pupa/normal.h: Include <pupa/err.h>.
1573 (pupa_set_history): New prototype.
1574 (pupa_iterate_commands): New prototype.
1575 * normal/cmdline.c: Include <pupa/machine/partition.h>,
1576 <pupa/disk.h>, <pupa/file.h>.
1577 (hist_size): New variable.
1578 (hist_lines): Likewise.
1579 (hist_end): Likewise.
1580 (hist_used): Likewise.
1581 (pupa_set_history): New function.
1582 (pupa_history_get): Likewise.
1583 (pupa_history_add): Likewise.
1584 (pupa_history_replace): Likewise.
1585 (pupa_tab_complete): Likewise.
1586 (pupa_cmdline_run): Added tab completion and history buffer. Tab
1587 completion shows partitionnames while completing partitions, this
1588 feature was suggested by Jeff Bailey.
1589 * normal/command.c (pupa_iterate_commands): New function.
1590 * normal/main.c (PUPA_DEFAULT_HISTORY_SIZE): New macro.
1591 (pupa_normal_init): Initialize history buffer.
1592 (PUPA_MOD_INIT): Likewise.
1593 (pupa_normal_fini): Free the history buffer.
1594 (PUPA_MOD_FINI): Likewise.
1595
1596 * util/console.c (pupa_ncurses_getkey): Accept 127 as backspace
1597 key.
1598
1599 * aclocal.m4 (pupa_I386_CHECK_REGPARM_BUG): New DEFUN.
1600 * configure.ac [i386]: Check for regparam bug.
1601 (NESTED_FUNC_ATTR) [! i386]: Defined.
1602
1f7315a3 16032003-11-17 Marco Gerards <metgerards@student.han.nl>
1604
1605 * conf/i386-pc.rmk (sbin_UTILITIES): Added pupa-emu.
1606 (pupa_setup_SOURCES): Added util/i386/pc/getroot.c.
1607 (pupa_emu_SOURCES): New variable.
1608 (pupa_emu_LDFLAGS): Likewise.
1609 * include/pupa/fs.h (pupa_ext2_init) [PUPA_UTIL]: New prototype.
1610 (pupa_ext2_fini) [PUPA_UTIL]: Likewise.
1611 * include/pupa/normal.h (pupa_normal_init) [PUPA_UTIL]: Likewise.
1612 (pupa_normal_fini) [PUPA_UTIL]: Likewise.
1613 * include/pupa/setjmp.h [PUPA_UTIL]: Include <setjmp.h>.
1614 (pupa_jmp_buf): New typedef.
1615 (pupa_setjmp) [PUPA_UTIL]: New macro.
1616 (pupa_longjmp) [PUPA_UTIL]: Likewise.
1617 * include/pupa/term.h (struct pupa_term): New member `refresh'.
1618 (pupa_refresh): New prototype.
1619 * include/pupa/util/getroot.h: New file.
1620 * kern/misc.c (pupa_vsprintf): Refresh the screen after updating
1621 it.
1622 * kern/rescue.c (pupa_rescue_get_command_line): Likewise.
1623 (pupa_rescue_cmd_cat): Likewise.
1624 (pupa_rescue_cmd_ls): Likewise.
1625 (pupa_rescue_cmd_testload): Likewise.
1626 (pupa_rescue_cmd_lsmod): Likewise.
1627 * normal/cmdline.c (pupa_cmdline_get): Likewise.
1628 * normal/menu.c (run_menu): Likewise.
1629 * kern/term.c (pupa_cls): Likewise.
1630 (pupa_refresh): New function.
1631 * normal/normal.c (pupa_normal_init) [PUPA_UTIL]: New function.
1632 (pupa_normal_fini) [PUPA_UTIL]: Likewise.
1633 * util/console.c: New file.
1634
1635 * util/i386/pc/getroot.c: New file.
1636 * util/i386/pc/pupa-setup.c: Include <pupa/util/getroot.h>.
1637 (pupa_putchar): New function.
1638 (pupa_refresh): Likewise.
1639 (xgetcwd): Function moved to ...
1640 (strip_extra_slashes): Likewise.
1641 (get_prefix): Likewise.
1642 * util/i386/pc/getroot.c: ... here.
1643 (find_root_device): Function moved and renamed to...
1644 * util/i386/pc/getroot.c (pupa_find_root_device): ... here.
1645 Changed all callers.
1646 * util/i386/pc/pupa-setup.c (guess_root_device): Function moved
1647 and renamed to...
1648 * util/i386/pc/getroot.c (pupa_guess_root_device): ... here.
1649 Changed all callers.
1650 * util/misc.c (pupa_memalign): New function.
1651 (pupa_mm_init_region): Likewise.
1652 (pupa_register_exported_symbols): Likewise.
1653 (pupa_putchar): Function removed.
1654 * util/pupa-emu.c: New file.
1655
9a5c1ade 16562003-11-16 Jeroen Dekkers <jeroen@dekkers.cx>
1657
1658 * conf/i386-pc.rmk (pkgdata_MODULES): Add _multiboot.mod.
1659 (_multiboot_mod_SOURCES): New variable.
1660 (_multiboot_mod_CFLAGS): Likewise.
1661 * loader/i386/pc/multiboot.c: New file.
1662 * include/pupa/i386/pc/multiboot.h: Likewise.
1663 * kern/i386/pc/startup.S: Include pupa/machine/multiboot.h.
1664 (pupa_multiboot_real_boot): New function.
1665 * include/pupa/i386/pc/loader.h: Include pupa/machine/multiboot.h.
1666 (pupa_multiboot_real_boot): New prototype.
1667 (pupa_rescue_cmd_multiboot): Likewise
1668 (pupa_rescue_cmd_module): Likewise.
1669
1670 * kern/loader.c (pupa_loader_set): Continue when
1671 pupa_loader_unload_func() fails.
1672 (pupa_loader_unset): New function.
1673 * include/pupa/loader.h (pupa_loader_unset): New prototype.
1674
1675 * kern/misc.c (pupa_stpcpy): New function.
1676 * include/pupa/misc.h (pupa_stpcpy): New prototype.
1677
8e72a9c0 16782003-11-12 Marco Gerards <metgerards@student.han.nl>
1679
1680 * disk/i386/pc/biosdisk.c (pupa_biosdisk_open): Correctly check
1681 for available extensions.
1682
1683 * include/pupa/i386/pc/time.h: New file.
1684 * kern/disk.c: Include <pupa/machine/time.h>.
1685 (PUPA_CACHE_TIMEOUT): New macro.
1686 (pupa_last_time): New variable.
1687 (pupa_disk_open): Flush the cache when there was a timeout.
1688 (pupa_disk_close): Reset the timer.
1689 * kern/i386/pc/startup.S (pupa_get_rtc): Renamed from
1690 pupa_currticks.
1691 * util/misc.c: Include <sys/times.h>
1692 (pupa_get_rtc): New function.
1693
c4adbd32 16942003-11-09 Jeroen Dekkers <jeroen@dekkers.cx>
1695
1696 * fs/ext2.c (struct pupa_ext2_inode): Declare struct datablocks
1697 as blocks.
1698 (pupa_ext2_get_file_block): Use blocks member.
1699
1700 * fs/ext2.c (pupa_ext2_read_file): Only set skipfirst for the
1701 first block. Return -1 instead of pupa_errno on error.
1702
bfd30f06 17032003-10-27 Marco Gerards <metgerards@student.han.nl>
1704
1705 * README: In the pupa-mkimage example use _chain instead of chain
1706 and ext2 instead of fat.
1707 * TODO: Replace ext2fs with jfs as an example. Add an item for
1708 adding journal playback for ext2fs.
1709 * conf/i386-pc.rmk (pupa_setup_SOURCES): Added fs/ext2.c.
1710 (pkgdata_MODULES): Added ext2.mod.
1711 (ext2_mod_SOURCES): New variable.
1712 (ext2_mod_CFLAGS): Likewise.
1713 * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_SYMLINK_LOOP.
1714 * include/pupa/misc.h (pupa_strncpy): New prototype.
1715 (pupa_strcat): Likewise.
1716 (pupa_strncmp): Likewise.
1717 * kern/misc.c (pupa_strcat): Enable function.
1718 (pupa_strncpy): New function.
1719 (pupa_strncmp): Likewise.
1720 * fs/ext2.c: New file.
1721
1722 * kern/disk.c (pupa_disk_read): Set pupa_errno to PUPA_ERR_NONE
1723 when the read failed before retrying.
1724 * util/i386/pc/biosdisk.c (_LARGEFILE_SOURCE): Removed.
1725 (_FILE_OFFSET_BITS): Likewise.
1726 * configure.ac: Added AC_SYS_LARGEFILE.
1727
98d15063 17282003-09-25 Yoshinori K. Okuji <okuji@enbug.org>
1729
1730 * genmk.rb (PModule#rule): Make sure to get only symbol names
1731 from the output of nm.
1732 Reported by Robert Millan <zeratul2@wanadoo.es>.
1733
18d9c7cd 17342003-09-25 Yoshinori K. Okuji <okuji@enbug.org>
1735
1736 I forgot to check in these changes for a long time. This adds
1737 incomplete support for VGA console, and this is still very
1738 buggy. Also, a lot of consideration is required for I18N,
1739 UNICODE, and VGA font issues. Therefore, assume that this is
1740 such that "better than nothing".
1741
1742 * font/manager.c: New file.
1743 * include/pupa/font.h: Likewise.
1744 * include/pupa/i386/pc/vga.h: Likewise.
1745 * term/i386/pc/vga.c: Likewise.
1746 * util/unifont2pff.rb: Likewise.
1747
1748 * conf/i386-pc.rmk (kernel_img_HEADERS): Added machine/vga.h.
1749 (pkgdata_MODULES): Added vga.mod and font.mod.
1750 (vga_mod_SOURCES): New variables.
1751 (vga_mod_CFLAGS): Likewise.
1752 (font_mod_SOURCES): Likewise.
1753 (font_mod_CFLAGS): Likewise.
1754
1755 * include/pupa/err.h (PUPA_ERR_BAD_FONT): New constant.
1756
1757 * include/pupa/term.h: Include pupa/err.h.
1758 (struct pupa_term): Added init and fini.
1759 Changed the argument of putchar to pupa_uint32_t.
1760
1761 * include/pupa/i386/pc/console.h: Include pupa/symbol.h.
1762 (pupa_console_real_putchar): New prototype.
1763 (pupa_console_putchar): Removed.
1764 (pupa_console_checkkey): Exported.
1765 (pupa_console_getkey): Likewise.
1766
1767 * kern/misc.c (pupa_vsprintf): Add support for UNICODE
1768 characters.
1769
1770 * kern/term.c (pupa_term_set_current): Rewritten.
1771 (pupa_putchar): Likewise.
1772 (pupa_putcode): New function.
1773
1774 * kern/i386/pc/startup.S (pupa_console_putchar): Renamed to ...
1775 (pupa_console_real_putchar): ... this.
1776 (pupa_vga_set_mode): New function.
1777 (pupa_vga_get_font): Likewise.
1778
1779 * normal/command.c: Include pupa/term.h.
1780 (terminal_command): New function.
1781 (pupa_command_init): Register the command "terminal".
1782
1783 * normal/menu.c (DISP_LEFT): Changed to a UNICODE value.
1784 (DISP_UP): Likewise.
1785 (DISP_RIGHT): Likewise.
1786 (DISP_DOWN): Likewise.
1787 (DISP_HLINE): Likewise.
1788 (DISP_VLINE): Likewise.
1789 (DISP_UL): Likewise.
1790 (DISP_UR): Likewise.
1791 (DISP_LL): Likewise.
1792 (DISP_LR): Likewise.
1793
1794 * term/i386/pc/console.c (pupa_console_putchar): New function.
1795
977329f5 17962003-02-08 NIIBE Yutaka <gniibe@m17n.org>
1797
1798 * util/resolve.c (pupa_util_resolve_dependencies): BUG
1799 FIX. Reverse the path_list.
1800
1801 * include/pupa/normal.h: Export pupa_register_command and
1802 pupa_unregister_command.
1803
1804 * hello/hello.c (pupa_cmd_hello): New module.
1805 * conf/i386-pc.rmk: Added hello.mod.
1806
1f5ab428 18072003-01-31 Yoshinori K. Okuji <okuji@enbug.org>
1808
1809 * kern/i386/pc/lzo1x.S: New file.
1810
1811 * util/i386/pc/pupa-mkimage.c: Include lzo1x.h.
1812 (compress_kernel): New variable.
1813 (generate_image): Heavily modified to support compressing a
1814 large part of the core image.
1815
1816 * util/misc.c (pupa_util_read_image): Fix a file descriptor
1817 leak.
1818 (pupa_util_load_image): New function.
1819
1820 * kern/i386/pc/startup.S: Include pupa/machine/kernel.h.
1821 (pupa_compressed_size): New variable.
1822 (codestart): Enable Gate A20 here.
1823 Decompress the compressed part of the core image.
1824 Rearrange the code to put functions and variables which are
1825 required for initialization in the non-compressed part.
1826 Include lzo1x.S.
1827
1828 * kern/i386/pc/init.c (pupa_machine_init): Don't enable Gate A20
1829 here.
1830
1831 * include/pupa/util/misc.h (pupa_util_write_image): Declared.
1832
1833 * include/pupa/i386/pc/kernel.h
1834 (PUPA_KERNEL_MACHINE_COMPRESSED_SIZE): New macro.
1835 (PUPA_KERNEL_MACHINE_INSTALL_DOS_PART): Increased by 4.
1836 (PUPA_KERNEL_MACHINE_INSTALL_BSD_PART): Likewise.
1837 (PUPA_KERNEL_MACHINE_PREFIX): Likewise.
1838 (PUPA_KERNEL_MACHINE_RAW_SIZE): New macro.
1839
1840 * conf/i386-pc.rmk (pupa_mkimage_LDFLAGS): New variable.
1841
1842 * genmk.rb (Image#rule): Put LDFLAGS at the end of a line.
1843 (Utility#rule): Likewise.
1844
1845 * configure.ac: Check if LZO is available.
1846
ce5bf700 18472003-01-20 Yoshinori K. Okuji <okuji@enbug.org>
1848
1849 * include/pupa/normal.h: New file.
1850 * include/pupa/setjmp.h: Likewise.
1851 * include/pupa/i386/setjmp.h: Likewise.
1852 * normal/cmdline.c: Likewise.
1853 * normal/command.c: Likewise.
1854 * normal/main.c: Likewise.
1855 * normal/menu.c: Likewise.
1856 * normal/i386/setjmp.S: Likewise.
1857
1858 * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global.
1859 (pupa_rescue_cmd_initrd): Likewise.
1860
1861 * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader):
1862 Likewise.
1863
1864 * kern/i386/pc/startup.S (translation_table): New variable.
1865 (translate_keycode): New function.
1866 (pupa_console_getkey): Call translate_keycode.
1867
1868 * kern/rescue.c (attempt_normal_mode): New function.
1869 (pupa_enter_rescue_mode): Attempt to execute the normal mode. If
1870 it failed, print a message.
1871
1872 * kern/mm.c (pupa_real_malloc): Print more information when a
1873 free magic is broken.
1874 (pupa_free): If the first free header is not free actually, set
1875 it to P.
1876
1877 * kern/main.c (pupa_load_normal_mode): Just load the module
1878 "normal".
1879 (pupa_main): Don't print the message
1880 "Entering into rescue mode..." here.
1881
1882 * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd):
1883 Declared.
1884 (pupa_rescue_cmd_initrd): Likewise.
1885 (pupa_rescue_cmd_initrd): Likewise.
1886
1887 * include/pupa/symbol.h (FUNCTION): Specify the type.
1888 (VARIABLE): Likewise.
1889
1890 * include/pupa/err.h (pupa_err_t): Added
1891 PUPA_ERR_UNKNOWN_COMMAND.
1892
1893 * include/pupa/dl.h (pupa_dl_set_prefix): Exported.
1894 (pupa_dl_get_prefix): Likewise.
1895
1896 * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod.
1897 Added _chain.mod and _linux.mod instead of chain.mod and
1898 linux.mod.
1899 (chain_mod_SOURCES): Renamed to ...
1900 (_chain_mod_SOURCES): ... this.
1901 (chain_mod_CFLAGS): Renamed to ...
1902 (_chain_mod_CFLAGS): ... this.
1903 (linux_mod_SOURCES): Renamed to ...
1904 (_linux_mod_SOURCES): ... this.
1905 (linux_mod_CFLAGS): Renamed to ...
1906 (_linux_mod_CFLAGS): ... this.
1907 (normal_mod_SOURCES): New variable.
1908 (normal_mod_CFLAGS): Likewise.
1909 (normal_mod_ASFLAGS): Likewise.
1910
19112003-01-18 Yoshinori K. Okuji <okuji@enbug.org>
1912
1913 * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if
1914 possible.
1915
1916 * kern/dl.c (pupa_dl_ref): Refer dependending modules
1917 recursively.
1918 (pupa_dl_unref): Unrefer depending modules recursively.
1919 Don't call pupa_dl_unload implicitly, because PUPA can crash if
1920 a module is unloaded before one depending on that module is
1921 unloaded.
1922 (pupa_dl_unload): Unload depending modules explicitly,
1923 if possible.
1924
c04da074 19252003-01-17 Yoshinori K. Okuji <okuji@enbug.org>
1926
1927 * include/pupa/i386/pc/linux.h: New file.
1928 * loader/i386/pc/linux.c: Likewise.
1929
1930 * loader/i386/pc/chainloader.c (pupa_chainloader_boot_sector):
1931 Removed.
1932 (pupa_chainloader_unload): Return PUPA_ERR_NONE.
1933 (pupa_rescue_cmd_chainloader): Read the image to 0x7C00 instead
1934 of PUPA_CHAINLOADER_BOOT_SECTOR.
1935
1936 * kern/i386/pc/startup.S: Include pupa/machine/linux.h.
1937 (pupa_linux_prot_size): New variable.
1938 (pupa_linux_tmp_addr): Likewise.
1939 (pupa_linux_real_addr): Likewise.
1940 (pupa_linux_boot_zimage): New function.
1941 (pupa_linux_boot_bzimage): Likewise.
1942
1943 * kern/i386/pc/init.c (struct mem_region): New structure.
1944 (MAX_REGIONS): New macro.
1945 (mem_regions): New variable.
1946 (num_regions): Likewise.
1947 (pupa_os_area_addr): Likewise.
1948 (pupa_os_area_size): Likewise.
1949 (pupa_lower_mem): Likewise.
1950 (pupa_upper_mem): Likewise.
1951 (add_mem_region): New function.
1952 (compact_mem_regions): Likewise.
1953 (pupa_machine_init): Set PUPA_LOWER_MEM and PUPA_UPPER_MEM to
1954 the size of the conventional memory and that of so-called upper
1955 memory (before the first memory hole).
1956 Instead of adding each found region to free memory, use
1957 add_mem_region and add them after removing overlaps.
1958 Also, add only 1/4 of the upper memory to free memory. The rest
1959 is used for loading OS images. Maybe this is ad hoc, but this
1960 makes it much easier to relocate OS images when booting.
1961
1962 * kern/rescue.c (pupa_rescue_cmd_module): Removed.
1963 (pupa_enter_rescue_mode): Don't register initrd and module.
1964
1965 * kern/mm.c: Include pupa/dl.h.
1966
1967 * kern/main.c: Include pupa/file.h and pupa/device.h.
1968
1969 * kern/loader.c (pupa_loader_load_module_func): Removed.
1970 (pupa_loader_load_module): Likewise.
1971
1972 * kern/dl.c (pupa_dl_load): Use the suffix ``.mod'' instead of
1973 ``.o''.
1974
1975 * include/pupa/i386/pc/loader.h (pupa_linux_prot_size): Declared.
1976 (pupa_linux_tmp_addr): Likewise.
1977 (pupa_linux_real_addr): Likewise.
1978 (pupa_linux_boot_zimage): Likewise.
1979 (pupa_linux_boot_bzimage): Likewise.
1980
1981 * include/pupa/i386/pc/init.h (pupa_lower_mem): Declared.
1982 (pupa_upper_mem): Likewise.
1983 (pupa_gate_a20): Don't export, because turning off Gate A20 in a
1984 module is too dangerous.
1985
1986 * include/pupa/loader.h (pupa_os_area_addr): Declared.
1987 (pupa_os_area_size): Likewise.
1988 (pupa_loader_set): Remove the first argument. Loader doesn't
1989 manage modules or initrd any longer.
1990 (pupa_loader_load_module): Removed.
1991
1992 * conf/i386-pc.rmk (pkgdata_MODULES): Added linux.mod.
1993 (linux_mod_SOURCES): New variable.
1994 (linux_mod_CFLAGS): Likewise.
1995
a13f9237 19962003-01-07 Yoshinori K. Okuji <okuji@enbug.org>
1997
1998 * util/i386/pc/pupa-setup.c (setup): Convert the endianness of
1999 the length of a blocklist correctly.
2000
2001 * util/i386/pc/biosdisk.c (pupa_util_biosdisk_open) [__linux__]:
2002 Use ioctl only if the OS file is a block device.
2003 (pupa_util_biosdisk_open): Don't use ST.ST_BLOCKS, because it is
2004 not very useful for normal files.
2005
2006 * kern/main.c (pupa_set_root_dev): New function.
2007 (pupa_load_normal_mode): Likewise.
2008 (pupa_main): Call those above.
2009
2010 * include/pupa/types.h (pupa_swap_bytes16): Cast the result to
2011 pupa_uint16_t.
2012
2013 * include/pupa/kernel.h (pupa_enter_normal_mode): Removed.
2014
a5ffe966 20152003-01-06 Yoshinori K. Okuji <okuji@enbug.org>
2016
2017 * util/i386/pc/pupa-setup.c: Include pupa/machine/kernel.h.
2018 (setup): Configure the installed partition information and the
2019 dl prefix.
2020
2021 * loader/i386/pc/chainloader.c (my_mod): New variable.
2022 (pupa_chainloader_unload): New function.
2023 (pupa_rescue_cmd_chainloader): Refer itself.
2024 (PUPA_MOD_INIT): Save its own module in MY_MOD.
2025
2026 * kern/i386/pc/startup.S (install_partition): Removed.
2027 (version_string): Likewise.
2028 (config_file): Likewise.
2029 (pupa_install_dos_part): New variable.
2030 (pupa_install_bsd_part): Likewise.
2031 (pupa_prefix): Likewise.
2032 (pupa_chainloader_real_boot): Call pupa_dl_unload_all.
2033
2034 * kern/i386/pc/init.c: Include pupa/machine/kernel.h, pupa/dl.h
2035 and pupa/misc.h.
2036 (make_install_device): New function.
2037 (pupa_machine_init): Set the dl prefix.
2038
2039 * kern/rescue.c: Include pupa/rescue.h and pupa/dl.h.
2040 (buf): Renamed to ...
2041 (linebuf): ... this.
2042 (pupa_rescue_cmd_prefix): New function.
2043 (pupa_rescue_cmd_insmod): Likewise.
2044 (pupa_rescue_cmd_rmmod): Likewise.
2045 (pupa_rescue_cmd_lsmod): Likewise.
2046 (pupa_enter_rescue_mode): Register new commands: prefix, insmod,
2047 rmmod and lsmod.
2048
2049 * kern/mm.c (pupa_memalign): If failed even after invalidating
2050 disk caches, unload unneeded modules and retry.
2051
2052 * kern/misc.c (pupa_memmove): New function.
2053 (pupa_memcpy): Removed.
2054 (pupa_strcpy): New function.
2055 (pupa_itoa): Made static.
2056
2057 * kern/dl.c (pupa_dl_iterate): New function.
2058 (pupa_dl_ref): Likewise.
2059 (pupa_dl_unref): Likewise.
2060 (pupa_dl_unload): Return if succeeded or not.
2061 (pupa_dl_unload_unneeded): New function.
2062 (pupa_dl_unload_all): Likewise.
2063 (pupa_dl_init): Renamed to ...
2064 (pupa_dl_set_prefix): ... this.
2065 (pupa_dl_get_prefix): New function.
2066
2067 * include/pupa/i386/pc/kernel.h: Include pupa/types.h.
2068 (PUPA_KERNEL_MACHINE_INSTALL_DOS_PART): New macro.
2069 (PUPA_KERNEL_MACHINE_INSTALL_BSD_PART): Likewise.
2070 (PUPA_KERNEL_MACHINE_PREFIX): Likewise.
2071 (pupa_install_dos_part): Declared.
2072 (pupa_install_bsd_part): Likewise.
2073 (pupa_prefix): Likewise.
2074 (pupa_boot_drive): Likewise.
2075
2076 * include/pupa/types.h: Fix a typo.
2077
2078 * include/pupa/misc.h (pupa_memcpy): New macro. Just an alias to
2079 pupa_memmove.
2080 (pupa_memmove): Declared.
2081 (pupa_strcpy): Likewise.
2082
2083 * include/pupa/dl.h (PUPA_MOD_INIT): Change the prototype. Now
2084 pupa_mod_init takes one argument, its own module.
2085 (pupa_dl_unload_unneeded): Declared.
2086 (pupa_dl_unload_all): Likewise.
2087 (pupa_dl_ref): Likewise.
2088 (pupa_dl_unref): Likewise.
2089 (pupa_dl_iterate): Likewise.
2090 (pupa_dl_init): Renamed to ...
2091 (pupa_dl_set_prefix): ... this.
2092 (pupa_dl_get_prefix): Declared.
2093
2094 * fs/fat.c [!PUPA_UTIL] (my_mod): New variable.
2095 (pupa_fat_dir) [!PUPA_UTIL]: Prevent the fat module from being
2096 unloaded.
2097 (pupa_fat_open) [!PUPA_UTIL]: Refer itself if succeeded.
2098 (pupa_fat_close) [!PUPA_UTIL]: Unrefer itself.
2099
2100 * configure.ac (tmp_CFLAGS): Added -Wshadow, -Wpointer-arith,
2101 -Wmissing-prototypes, -Wundef and -Wstrict-prototypes.
2102
012d7999 21032003-01-03 Yoshinori K. Okuji <okuji@enbug.org>
2104
2105 * util/i386/pc/pupa-setup.c (setup): Define the internal
2106 function find_first_partition_start at the top level, because GCC
2107 3.0.x cannot compile internal functions in deeper scopes
2108 correctly.
2109 (find_root_device): Use lstat instead of stat.
2110 Don't follow symbolic links.
2111 Fix the path-constructing code.
2112
2113 * util/i386/pc/biosdisk.c [__linux__] (BLKFLSBUF): New macro.
2114 (pupa_util_biosdisk_open) [__linux__]: Get the size of a device
2115 by a BLKGETSIZE ioctl first, because block devices don't fill
2116 the member st_mode of the structure stat on Linux.
2117 [__linux__] (linux_find_partition): Use a temporary buffer
2118 REAL_DEV for the working space. Copy it to DEV before returning.
2119 (open_device) [__linux__]: Call ioctl with BLKFLSBUF to make the
2120 buffer cache consistent.
2121 (get_os_disk) [__linux__]: Use the length 5 instead of 4 for
2122 strncmp. The previous value was merely wrong.
2123 (pupa_util_biosdisk_get_pupa_dev): Use stat instead of lstat.
2124
2125 * fs/fat.c (pupa_fat_read_data): Shift 4 instead of 12 when the
2126 FAT size is 12. The previous value was merely wrong.
2127
2128 * kern/main.c (pupa_main): Don't split the starting message from
2129 newlines.
2130
2131 * kern/term.c (pupa_putchar): Put CR after LF instead of before
2132 LF, because BIOS goes crazy about character attributes in this
2133 case.
2134
1cc73a62 21352003-01-03 Yoshinori K. Okuji <okuji@enbug.org>
2136
2137 * include/i386/pc/util/biosdisk.h: New file.
2138 * util/i386/pc/biosdisk.c: Likewise.
2139 * util/i386/pc/pupa-setup.c: Likewise.
2140
2141 * Makefile.in (INCLUDE_DISTFILES): Added
2142 include/pupa/i386/pc/util/biosdisk.h.
2143 (UTIL_DISTFILES): Added biosdisk.c and pupa-setup.c under the
2144 directory util/i386/pc.
2145 (install-local): Added a rule for sbin_UTILITIES.
2146 (uninstall): Likewise.
2147
2148 * util/i386/pc/pupa-mkimage.c (usage): Fix a typo in the doc.
2149
2150 * util/misc.c (xrealloc): New function.
2151 (pupa_malloc): Likewise.
2152 (pupa_free): Likewise.
2153 (pupa_realloc): Likewise.
2154 (pupa_stop): Likewise.
2155 (pupa_putchar): Likewise.
2156
2157 * kern/disk.c (pupa_disk_read): Prevent L from underflowing.
2158
2159 * include/pupa/util/misc.h (xrealloc): Declared.
2160
2161 * include/pupa/i386/pc/boot.h (PUPA_BOOT_MACHINE_BPB_START): New
2162 macro.
2163 (PUPA_BOOT_MACHINE_BPBEND): Renamed to ...
2164 (PUPA_BOOT_MACHINE_BPB_END): ... this.
2165
2166 * include/pupa/fs.h [PUPA_UTIL] (pupa_fat_init): Declared.
2167 [PUPA_UTIL] (pupa_fat_fini): Likewise.
2168
2169 * fs/fat.c [PUPA_UTIL] (pupa_fat_init): Defined. Maybe a better
2170 way should be implemented.
2171 [PUPA_UTIL] (pupa_fat_fini): Likewise.
2172
2173 * disk/i386/pc/biosdisk.c (pupa_biosdisk_call_hook): Increase
2174 the size of NAME for safety.
2175 (pupa_biosdisk_iterate): Search hard disks to 0x90 instead of
2176 0x88.
2177
2178 * conf/i386-pc.rmk (sbin_UTILITIES): New variable.
2179 (pupa_setup_SOURCES): Likewise.
2180
2181 * genmk.rb (Utility#rule): Add $(BUILD_CFLAGS) into the rules.
2182
08b70fe8 21832002-12-28 Yoshinori K. Okuji <okuji@enbug.org>
2184
2185 * kern/i386/pc/startup.S (push_get_mmap_entry): Revert to a
2186 bunch of pushl's from pusha, because this destroys the return
2187 value.
2188
62ddcc8f 21892002-12-28 Yoshinori K. Okuji <okuji@enbug.org>
2190
2191 Use -mrtd and -mregparm=3 to reduce the generated code sizes.
2192 This means that any missing prototypes could be fatal. Also, you
2193 must take care when writing assembly code. See the comments at
2194 the beginning of startup.S, for more details.
2195
2196 * kern/i386/pc/startup.S (pupa_halt): Modified for the new
2197 compilation mechanism.
2198 (pupa_chainloader_real_boot): Likewise.
2199 (pupa_biosdisk_rw_int13_extensions): Likewise.
2200 (pupa_biosdisk_rw_standard): Likewise.
2201 (pupa_biosdisk_check_int13_extensions): Likewise.
2202 (pupa_biosdisk_get_diskinfo_int13_extensions): Likewise.
2203 (pupa_biosdisk_get_diskinfo_standard): Likewise.
2204 (pupa_get_memsize): Likewise.
2205 (pupa_get_mmap_entry): Likewise.
2206 (pupa_console_putchar): Likewise.
2207 (pupa_console_setcursor): Likewise.
2208 (pupa_getrtsecs): Use pushl instead of push.
2209
2210 * kern/i386/pc/init.c (pupa_machine_init): Use the scratch
2211 memory instead of the stack for a mmap entry, because some
2212 BIOSes may ignore the maximum size and overflow.
2213
2214 * conf/i386-pc.rmk (COMMON_CFLAGS): Added -mrtd and -mregparm=3.
2215
2216 * genmk.rb (PModule#rule): Compile automatically generated
2217 sources with module-specific CFLAGS as well as other sources.
2218
9962ed99 22192002-12-27 Yoshinori K. Okuji <okuji@enbug.org>
2220
2221 * configure.ac: Check ld.
2222 Replace CFLAGS and CPPFLAGS with BUILD_CFLAGS and BUILD_CPPFLAGS
2223 respectively, before checking endianness and sizes.
2224
2225 * Makefile.in (LD): New variable.
2226
abdfc3c5 22272002-12-27 Yoshinori K. Okuji <okuji@enbug.org>
2228
2229 * Makefile.in (BUILD_CC): CC -> BUILD_CC.
2230
6a161fa9 22312002-12-27 Yoshinori K. Okuji <okuji@enbug.org>
2232
2233 * Changelog: New file.
2234