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