1 2004-12-27 Marco Gerards <metgerards@student.han.nl>
3 * genmk.rb: Handle the `Program' class in the main loop. Written
4 by Johan Rydberg <jrydberg@gnu.org>.
6 (programs): New variable.
7 * boot/powerpc/ieee1275/cmain.c: Include <grub/machine/ieee1275.h>
8 instead of "grub/machine/ieee1275.h". Include <grub/kernel.h>
9 instead of "grub/kernel.h". Include <grub/machine/init.h>.
10 (help_arch): Function removed.
11 * conf/powerpc-ieee1275.rmk (grubof_HEADERS): Add
12 `powerpc/libgcc.h' and `loader.h'.
13 (pkgdata_PROGRAMS): New variable.
14 (sbin_UTILITIES): Variable removed.
15 (grub_emu_SOURCES): Added kern/powerpc/cache.S.
16 (grubof_SOURCES): Variable re-defined so it only includes the
18 (grubof_CFLAGS): Remove `-DGRUBOF'.
19 (pkgdata_MODULES, fshelp_mod_SOURCES, fshelp_mod_CFLAGS,
20 (fat_mod_SOURCES, fat_mod_CFLAGS, ext2_mod_SOURCES)
21 (ext2_mod_CFLAGS, ufs_mod_SOURCES, ufs_mod_CFLAGS)
22 (minix_mod_SOURCES, minix_mod_CFLAGS, hfs_mod_SOURCES)
23 (hfs_mod_CFLAGS, jfs_mod_SOURCES, jfs_mod_CFLAGS)
24 (iso9660_mod_SOURCES, iso9660_mod_CFLAGS, _linux_mod_SOURCES)
25 (_linux_mod_CFLAGS, linux_mod_SOURCES, linux_mod_CFLAGS)
26 (normal_mod_SOURCES, normal_mod_CFLAGS, normal_mod_ASFLAGS)
27 (hello_mod_SOURCES, hello_mod_CFLAGS, boot_mod_SOURCES)
28 (boot_mod_CFLAGS, terminal_mod_SOURCES, terminal_mod_CFLAGS)
29 (ls_mod_SOURCES, ls_mod_CFLAGS, cmp_mod_SOURCES, cmp_mod_CFLAGS)
30 (cat_mod_SOURCES, cat_mod_CFLAGS, font_mod_SOURCES)
31 (font_mod_CFLAGS, amiga_mod_SOURCES, amiga_mod_CFLAGS)
32 (apple_mod_SOURCES, apple_mod_CFLAGS, pc_mod_SOURCES)
33 (pc_mod_CFLAGS): New variables.
34 * disk/powerpc/ieee1275/ofdisk.c: Include <grub/machine/init.h>.
35 (grub_ofdisk_iterate): Add a prototype for `dev_iterate'.
36 * include/grub/dl.h (grub_arch_dl_sync_caches): New prototype.
37 * include/grub/loader.h (grub_os_area_addr, grub_os_area_size):
39 * include/grub/i386/pc/init.h (grub_os_area_addr)
40 (rub_os_area_size): ... to here.
41 * include/grub/powerpc/ieee1275/ieee1275.h
42 (grub_ieee1275_entry_fn): Export symbol.
43 * include/grub/powerpc/ieee1275/init.h: New file.
44 * include/grub/powerpc/libgcc.h: Likewise.
45 * include/grub/cache.h: Likewise.
46 * kern/powerpc/cache.S: Likewise. Written by Hollis Blanchard
47 <hollis@penguinppc.org>.
48 * kern/dl.c: Include <grub/cache.h>.
49 (grub_dl_flush_cache): New function.
50 (grub_dl_load_core): Call `grub_dl_flush_cache' to flush the cache
52 * kern/powerpc/ieee1275/init.c (grub_ofdisk_init)
53 (grub_console_init): Removed prototypes.
54 (grub_machine_init): Don't initialize the modules anymore.
55 * kern/powerpc/ieee1275/openfw.c (grub_map): Make the function
57 * include/grub/powerpc/types.h (GRUB_HOST_WORDS_LITTLEENDIAN):
59 (GRUB_HOST_WORDS_BIGENDIAN): New macro.
60 * kern/powerpc/dl.c (grub_arch_dl_relocate_symbols): Add
61 relocation `R_PPC_REL32'. Return an error when the relocation is
63 * Makefile.in (DATA): Add `$(pkgdata_PROGRAMS)'.
64 * kern/i386/pc/init.c (grub_arch_sync_caches): New function.
65 * util/misc.c (grub_arch_sync_caches): Likewise.
67 2004-12-19 Marco Gerards <metgerards@student.han.nl>
69 * conf/powerpc-ieee1275.rmk (MOSTLYCLEANFILES): Remove
70 `symlist.c', add `grubof_symlist.c'.
71 (symlist.c): Variable removed.
72 (grubof_HEADERS): Variable added.
73 (grubof_symlist.c): New target.
74 (kernel_syms.lst): Use `grubof_HEADERS' instead of
76 (grubof_SOURCES): Add `kern/powerpc/dl.c' and `grubof_symlist.c'.
77 * kern/powerpc/dl.c: New file.
78 * kern/powerpc/ieee1275/init.c (grub_arch_dl_check_header):
80 (grub_arch_dl_relocate_symbols): Likewise.
81 (grub_register_exported_symbols): Likewise.
83 2004-12-13 Marco Gerards <metgerards@student.han.nl>
85 * fs/ext2.c (grub_ext2_open): Don't use data after freeing it.
86 (grub_ext2_dir): Likewise. Don't return in case of an error, jump
87 to fail instead. Reported by Vincent Pelletier
88 <subdino2004@yahoo.fr>.
90 * fs/fshelp.c (grub_fshelp_find_file): Don't free `oldnode' when
91 it is not allocated. Reported by Vincent Pelletier
92 <subdino2004@yahoo.fr>.
94 * normal/cmdline.c (grub_tab_complete): Add a blank line to the
95 output so the output looks better.
97 2004-12-04 Marco Gerards <metgerards@student.han.nl>
99 Modulize the partition map support and add support for the amiga
102 * commands/ls.c: Include <grub/partition.h> instead of
103 <grub/machine/partition.h>.
104 * kern/disk.c: Likewise.
105 * kern/rescue.c: Likewise.
106 * loader/i386/pc/chainloader.c: Likewise.
107 * normal/cmdline.c: Likewise.
108 * kern/powerpc/ieee1275/init.c: Likewise.
109 (grub_machine_init): Call `grub_pc_partition_map_init',
110 `grub_amiga_partition_map_init' and
111 `grub_apple_partition_map_init'.
112 * conf/i386-pc.rmk (kernel_img_SOURCES): Remove
113 `disk/i386/pc/partition.c'. Add `kern/partition.c'.
114 (kernel_img_HEADERS): Remove `machine/partition.h'. Add
115 `partition.h' and `pc_partition.h'.
116 (grub_setup_SOURCES): Remove
117 `disk/i386/pc/partition.c'. Add `kern/partition.c',
118 `partmap/amiga.c', `partmap/apple.c' and `partmap/pc.c'.
119 (grub_emu_SOURCES): Likewise.
120 (pkgdata_MODULES): Add `amiga.mod', `apple.mod' and `pc.mod'.
121 (amiga_mod_SOURCES, amiga_mod_CFLAGS, apple_mod_SOURCES)
122 (apple_mod_CFLAGS, pc_mod_SOURCES, pc_mod_CFLAGS): New variables.
123 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Remove
124 `disk/powerpc/ieee1275/partition.c'. Add `kern/partition.c',
125 `partmap/amiga.c', `partmap/apple.c' and `partmap/pc.c'.
126 (grubof_SOURCES): Likewise.
127 * disk/i386/pc/partition.c: File removed.
128 * disk/powerpc/ieee1275/partition.c: Likewise.
129 * include/grub/powerpc/ieee1275/partition.h: Likewise.
130 * include/grub/i386/pc/partition.h: Likewise.
131 * kern/partition.c: New file.
132 * partmap/amiga.c: Likewise.
133 * partmap/apple.c: Likewise.
134 * partmap/pc.c: Likewise.
135 * include/grub/partition.h: Likewise..
136 * include/grub/pc_partition.h: Likewise.
137 * util/grub-emu.c: Include <grub/partition.h> instead of
138 <grub/machine/partition.h>.
139 (main): Call `grub_pc_partition_map_init',
140 `grub_amiga_partition_map_init' and
141 `grub_apple_partition_map_init' and deinitialize afterwards.
142 * util/i386/pc/biosdisk.c: Include `#include
143 <grub/partition.h>' and `include <grub/pc_partition.h>' instead of
144 `<grub/machine/partition.h>'.
145 * util/i386/pc/grub-setup.c: Likewise.
146 * util/i386/pc/biosdisk.c: Likewise.
147 (grub_util_biosdisk_get_grub_dev): Only access the PC specific
148 partition information in case of a PC partition.
149 * util/i386/pc/grub-setup.c: Include `#include
150 <grub/partition.h>' and `include <grub/pc_partition.h>' instead of
151 `<grub/machine/partition.h>'.
152 (setup): Only access the PC specific partition information in case
155 2004-11-17 Hollis Blanchard <hollis@penguinppc.org>
157 * kern/powerpc/ieee1275/init.c (grub_setjmp): Remove function.
158 (grub_longjmp): Likewise.
159 * include/grub/powerpc/setjmp.h (grub_jmp_buf): Set array size to
161 * normal/powerpc/setjmp.S: New file.
162 * conf/powerpc-ieee1275.rmk (grubof_SOURCES): Add
163 `normal/powerpc/setjmp.S'.
164 (grubof_CFLAGS): Add `-DGRUBOF'.
165 * include/grub/setjmp.h [GRUB_UTIL]: Changed condition to
166 [GRUB_UTIL && !GRUBOF].
168 2004-11-16 Marco Gerards <metgerards@student.han.nl>
170 * kern/powerpc/ieee1275/openfw.c (grub_devalias_iterate): Skip any
171 property named `name'. Correctly handle the error returned by
172 `grub_ieee1275_finddevice' if a device can not be opened.
174 2004-11-02 Hollis Blanchard <hollis@penguinppc.org>
176 * term/powerpc/ieee1275/ofconsole.c (grub_ofconsole_readkey): Test
177 `actual' for negativity.
178 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Remove
181 2004-11-01 Marco Gerards <metgerards@student.han.nl>
183 * term/i386/pc/vga.c (VGA_HEIGHT): Changed to 350.
184 (PAGE_OFFSET): New macro.
185 (CRTC_ADDR_PORT): Likewise.
186 (CRTC_DATA_PORT): Likewise.
187 (START_ADDR_HIGH_REGISTER): Likewise.
188 (START_ADDR_LOW_REGISTER): Likewise.
189 (GRAPHICS_ADDR_PORT): Likewise.
190 (GRAPHICS_DATA_PORT): Likewise.
191 (READ_MAP_REGISTER): Likewise.
192 (INPUT_STATUS1_REGISTER): Likewise.
193 (INPUT_STATUS1_VERTR_BIT): Likewise.
194 (page): New variable.
195 (wait_vretrace): New function.
196 (set_read_map): Likewise.
197 (set_start_address): Likewise.
198 (grub_vga_init): Use mode 0x10 instead of mode 0x12. Switch to
200 (check_vga_mem): Take the page into account.
201 (write_char): Likewise.
202 (write_cursor): Likewise.
203 (scroll_up): Likewise. Copy the page to the page that is not
204 shown and switch between both pages.
205 (grub_vga_putchar): Fix off by one error.
206 (grub_vga_cls): Wait for the vertical retrace. Take the page into
209 2004-11-01 Marco Gerards <metgerards@student.han.nl>
211 Add support for iso9660 (including rockridge).
213 * conf/i386-pc.rmk (grub_emu_SOURCES): Add fs/iso9660.c.
214 (iso9660_mod_SOURCES): New variable.
215 (iso9660_mod_CFLAGS): Likewise.
216 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs/iso9660.c.
217 * include/grub/fs.h (grub_iso9660_init): New prototype.
218 * util/grub-emu.c (main): Call `grub_iso9660_init'.
219 * fs/iso9660.c: New file.
221 * include/grub/misc.h (grub_strncat): New prototype.
222 * kern/misc.c (grub_strncat): New function.
224 * fs/hfs.c (grub_hfs_mount): Translate the error
225 `GRUB_ERR_OUT_OF_RANGE' to `GRUB_ERR_BAD_FS'.
226 * fs/jfs.c (grub_jfs_mount): Likewise.
227 * fs/ufs.c (grub_ufs_mount): Likewise.
229 2004-10-28 Hollis Blanchard <hollis@penguinppc.org>
231 * boot/powerpc/ieee1275/cmain.c (cmain): Remove asm statements
232 which initialized BAT registers.
233 * boot/powerpc/ieee1275/ieee1275.c (IEEE1275_CALL_ENTRY_FN,
234 grub_ieee1275_common_hdr, INIT_IEEE1275_COMMON):
236 * include/grub/powerpc/ieee1275/ieee1275.h (IEEE1275_CALL_ENTRY_FN,
237 grub_ieee1275_common_hdr, INIT_IEEE1275_COMMON):
239 * kern/powerpc/ieee1275/openfw.c (grub_map): New function.
240 (grub_mapclaim): Likewise.
241 * loader/powerpc/ieee1275/linux.c (grub_load_linux): Use
242 grub_mapclaim instead of grub_ieee1275_claim. Assign linux_addr by
245 2004-10-19 Hollis Blanchard <hollis@penguinppc.org>
247 * conf/powerpc-ieee1275.rmk (COMMON_ASFLAGS): Remove -fno-builtin.
248 (COMMON_CFLAGS): Remove -fno-builtin and -D__ASSEMBLY__. Add
249 -ffreestanding and -msoft-float.
251 2004-10-15 Hollis Blanchard <hollis@penguinppc.org>
253 * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_open): Do not
254 append ":0" to devpath if the GRUB_IEEE1275_NO_PARTITION_0 flag is
255 set in grub_ieee1275_flags.
257 2004-10-14 Hollis Blanchard <hollis@penguinppc.org>
259 * include/grub/powerpc/ieee1275/ieee1275.h (abort): Add function
261 * kern/powerpc/ieee1275/init.c (grub_machine_init): Call
262 grub_console_init first.
263 Change the memory range used for grub_ieee1275_claim and
265 Print an error message if the claim fails.
266 Include <grub/misc.h>.
268 2004-10-13 Hollis Blanchard <hollis@penguinppc.org>
270 * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_iterate):
271 Call grub_children_iterate for device nodes of type `scsi',
273 (grub_ofdisk_open): Remove manual device alias resolution.
274 Fix memory leak when device cannot be opened.
275 * include/grub/powerpc/ieee1275/ieee1275.h
276 (grub_children_iterate): New prototype.
277 * kern/powerpc/ieee1275/openfw.c (grub_children_iterate):
279 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_get_property):
280 Return -1 if args.size was -1.
282 2004-10-11 Hollis Blanchard <hollis@penguinppc.org>
284 * boot/powerpc/ieee1275/cmain.c (grub_ieee1275_flags): New global.
285 (cmain): Accept 3 parameters. Test for 0xdeadbeef, indicating Old
286 World Macintosh. If Old Wold, set flag in grub_ieee1275_flags; claim
287 Open Firmware's memory for it; claim memory from _start to _end.
288 * boot/powerpc/ieee1275/crt0.S (__bss_start): New extern.
290 (_start): Zero BSS from __bss_start to _end.
291 * include/grub/powerpc/ieee1275/ieee1275.h (grub_ieee1275_flags):
293 (GRUB_IEEE1275_NO_PARTITION_0): New #define.
295 2004-10-11 Hollis Blanchard <hollis@penguinppc.org>
297 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_claim): Return
298 -1 if args.base was -1.
300 2004-10-08 Hollis Blanchard <hollis@penguinppc.org>
302 * term/powerpc/ieee1275/ieee1275.c (grub_ofconsole_cls): Use an ANSI
303 escape sequence instead of a literal ^L. Also call
304 grub_ofconsole_gotoxy.
306 2004-10-03 Hollis Blanchard <hollis@penguinppc.org>
308 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_claim): change
309 void * arguments to grub_addr_t. All callers updated. Also make
310 the `result' argument optional.
311 (grub_ieee1275_release): change void * arguments to grub_addr_t.
314 2004-09-22 Hollis Blanchard <hollis@penguinppc.org>
316 * commands/ls.c (grub_ls_list_files): Use the string following the
317 initial ')', if present, as the filesystem path.
318 * kern/rescue.c (grub_rescue_cmd_ls): Likewise.
320 * conf/powerpc-ieee1275.rmk (grubof_SOURCES): List crt0.S first.
322 2004-09-18 Yoshinori K. Okuji <okuji@enbug.org>
324 Make the source code of the menu interface more readable.
326 * normal/menu.c: Include grub/mm.h.
327 (TERM_WIDTH): New macro.
328 (TERM_HEIGHT): Likewise.
329 (TERM_INFO_HEIGHT): Likewise.
330 (TERM_MARGIN): Likewise.
331 (TERM_SCROLL_WIDTH): Likewise.
332 (TERM_TOP_BORDER_Y): Likewise.
333 (TERM_LEFT_BORDER_X): Likewise.
334 (TERM_BORDER_WIDTH): Likewise.
335 (TERM_MESSAGE_HEIGHT): Likewise.
336 (TERM_BORDER_HEIGHT): Likewise.
337 (TERM_NUM_ENTRIES): Likewise.
338 (TERM_FIRST_ENTRY_Y): Likewise.
339 (TERM_ENTRY_WIDTH): Likewise.
340 (TERM_CURSOR_X): Likewise.
341 (draw_border): Use macros instead of magic numbers.
342 (print_entry): Likewise.
343 (print_entries): Likewise.
344 (run_menu): Likewise. Also, handle the key 'e'.
345 (run_menu_entry): Ignore empty command lines.
346 (print_message): Added a new argument EDIT. If EDIT is true,
347 print a different message.
348 (init_page): Likewise.
349 (edit_menu_entry): New function. Not implemented yet.
351 2004-09-17 Marco Gerards <metgerards@student.han.nl>
353 Add `linux.mod' and `multiboot.mod' so linux and multiboot kernels
354 can be loaded from normal mode.
356 * conf/i386-pc.rmk (pkgdata_MODULES): Add `linux.mod' and
358 (linux_mod_SOURCES, linux_mod_CFLAGS, multiboot_mod_SOURCES)
359 (multiboot_mod_CFLAGS): New variables.
360 * loader/i386/pc/linux_normal.c: New file.
361 * loader/i386/pc/multiboot_normal.c: Likewise.
363 * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Don't use the
366 * fs/ext2.c (grub_ext2_iterate_dir): Fix typos in inode type. Use
367 `fdiro' to read the mode information from instead of `diro'.
369 * fs/fshelp.c (grub_fshelp_find_file): Set type to foundtype after
370 looking up a symlink.
372 * include/grub/normal.h (GRUB_COMMAND_FLAG_NO_ARG_PARSE): New
374 * normal/command.c (grub_command_execute): Don't parse the
375 arguments when `GRUB_COMMAND_FLAG_NO_ARG_PARSE' is set in the
376 flags of the command.
378 * normal/menu.c (grub_menu_run): Fix typo.
380 2004-09-14 Hollis Blanchard <hollis@penguinppc.org>
382 * kern/powerpc/ieee1275/init.c (abort): Trap into Open Firmware.
384 * term/powerpc/ieee1275/ofconsole.c (grub_ofconsole_gotoxy): Use
385 `y + 1' instead of `y - 1'.
387 * conf/powerpc-ieee1275.rmk (grubof_LDFLAGS): Add `-N' and `-S'.
389 2004-09-14 Yoshinori K. Okuji <okuji@enbug.org>
391 From Hollis Blanchard <hollis@penguinppc.org>:
392 * kern/misc.c (memmove): New alias for grub_memmove.
393 (memcmp): New alias for grub_memcmp.
394 (memset): New alias for grub_memset.
395 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_get_property):
396 Change "int handle" to "grub_ieee1275_phandle_t handle".
397 * include/grub/powerpc/ieee1275/ieee1275.h
398 (grub_ieee1275_get_property): Likewise.
400 2004-09-12 Tomas Ebenlendr <ebik@ucw.cz>
402 Added normal mode command `chainloader' as module chain.mod, which
403 depends on normal.mod and _chain.mod.
405 * conf/i386-pc.rmk (pkgdata_MODULES): Add `chain.mod'.
406 (chain_mod_SOURCES, chain_mod_CFLAGS): Variables added.
407 * include/grub/i386/pc/loader.h (grub_rescue_cmd_chainloader):
409 * loader/i386/pc/chainloader.c (grub_rescue_cmd_chainloader): All
410 but arguments parsing moved to ...
411 (grub_chainloader_cmd): ... here. New function.
412 * include/grub/i386/pc/chainloader.h: New file.
413 * loader/i386/pc/chainloader_normal.c: Likewise.
415 2004-09-11 Marco Gerards <metgerards@student.han.nl>
417 * conf/i386-pc.rmk (kernel_img_SOURCES): Added kern/fshelp.c.
418 (grub_mkimage_LDFLAGS): Likewise.
419 (grub_emu_SOURCES): Likewise.
420 (kernel_img_HEADERS): Added fshelp.h.
421 * fs/ext2.c: Include <grub/fshelp.h>.
422 (FILETYPE_REG): New macro.
423 (FILETYPE_INO_REG): Likewise.
424 (grub_ext_sblock): Renamed to `grub_ext2_sblock'.
426 (ext2_block_group): Renamed to `grub_ext2_block_group'. Changed
428 (grub_fshelp_node): New struct.
429 (grub_ext2_data): Added member `diropen'. Changed member `inode'
431 (grub_ext2_get_file_block): Removed function.
432 (grub_ext2_read_block): New function.
433 (grub_ext2_read_file): Replaced parameter `data' by `node'.
434 This function was written.
435 (grub_ext2_mount): Read the root inode. Create a diropen struct.
436 (grub_ext2_find_file): Removed function.
437 (grub_ext2_read_symlink): New function.
438 (grub_ext2_iterate_dir): Likewise.
439 (grub_ext2_open): Rewritten.
440 (grub_ext2_dir): Rewritten.
441 * include/grub/fshelp.h: New file.
442 * fs/fshelp.c: Likewise.
444 2004-09-10 Yoshinori K. Okuji <okuji@enbug.org>
446 * normal/menu.c: Include grub/loader.h and grub/machine/time.h.
447 (print_message): Add a missing newline.
448 (run_menu): Added timeout support.
449 (run_menu_entry): New local function.
450 (grub_menu_run): Added support for booting.
452 * kern/loader.c (grub_loader_is_loaded): New function.
454 * include/grub/powerpc/ieee1275/time.h: Include grub/symbol.h.
455 (grub_get_rtc): Exported.
457 * include/grub/i386/pc/time.h: Include grub/symbol.h.
458 (grub_get_rtc): Exported.
460 * include/grub/normal.h (struct grub_command_list): Remove
461 constant from the member `command'.
463 * include/grub/loader.h (grub_loader_is_loaded): Declared.
465 * include/grub/err.h (GRUB_ERR_INVALID_COMMAND): New constant.
467 * conf/i386-pc.rmk (kernel_img_HEADERS): Added machine/time.h.
469 2004-08-28 Marco Gerards <metgerards@student.han.nl>
471 Add support for the JFS filesystem.
473 * fs/jfs.c: New file.
474 * include/grub/fs.h (grub_jfs_init): New prototype.
475 (grub_jfs_fini): New prototype.
476 * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/jfs.c.
477 (grub_emu_SOURCES): Likewise.
478 (pkgdata_MODULES): Add jfs.mod.
479 (jfs_mod_SOURCES): New variable.
480 (jfs_mod_CFLAGS): Likewise.
481 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs.jfs.c.
482 (grubof_SOURCES): Likewise.
483 * util/grub-emu.c (main): Initialize and deinitialize JFS support.
485 * fs/fat.c (grub_fat_find_dir): Convert the filename little
486 endian to the host endian.
487 (grub_fat_utf16_to_utf8): Move function from there...
488 * kern/misc.c (grub_utf16_to_utf8): ...to here. Do not convert
489 the endianess of the source string anymore.
490 * include/grub/misc.h (grub_utf16_to_utf8): New prototype.
492 2004-08-24 Marco Gerards <metgerards@student.han.nl>
494 * commands/boot.c (grub_boot_init) [GRUB_UTIL]: Make conditional.
495 (grub_boot_fini) [GRUB_UTIL]: Likewise.
496 (GRUB_MOD_INIT) [!GRUB_UTIL]: Likewise.
497 (GRUB_MOD_FINI) [!GRUB_UTIL]: Likewise.
499 * fs/hfs.c (grub_hfs_find_node): Add a prototype for `node_found'.
500 (grub_hfs_iterate_dir): Make the function static. Add prototypes
501 for `node_found' and `it_dir'.
502 (grub_hfs_dir): Add prototype for `dir_hook'.
504 * fs/minix.c (grub_minix_get_file_block): Add prototype for
505 `grub_get_indir'. Rename `indir' in two blocks to `indir16'
506 and `indir32' to silence a gcc warning.
508 * include/grub/fs.h (grub_hfs_init): New prototype.
509 (grub_hfs_fini): Likewise.
512 2004-08-21 Yoshinori K. Okuji <okuji@enbug.org>
514 Each disk device has its own id now. This is useful to make use
515 of multiple disk devices.
517 * include/grub/disk.h (grub_disk_dev_id): New enum.
518 (GRUB_DISK_DEVICE_BIOSDISK_ID): New constant.
519 (GRUB_DISK_DEVICE_OFDISK_ID): Likewise.
521 * disk/i386/pc/biosdisk.c (grub_biosdisk_dev): Specify
522 GRUB_DISK_DEVICE_BIOSDISK_ID as an id.
524 * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_dev): Specify
525 GRUB_DISK_DEVICE_OFDISK_ID as an id.
527 * util/i386/pc/biosdisk.c (grub_util_biosdisk_dev): Specify
528 GRUB_DISK_DEVICE_BIOSDISK_ID as an id.
530 * include/grub/disk.h (struct grub_disk_dev): Added a new member
531 "id" which is used by the cache manager.
533 * normal/main.c (grub_normal_init_page): Use "GNU GRUB" instead
536 2004-08-18 Marco Gerards <metgerards@student.han.nl>
538 * fs/hfs.c: New file.
539 * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/hfs.c.
540 (grub_emu_SOURCES): Likewise.
541 (pkgdata_MODULES): Add hfs.mod.
542 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs/hfs.c.
543 (grubof_SOURCES): Likewise.
544 * util/grub-emu.c (main): Initialize and deinitialize HFS support.
546 * include/grub/misc.h (grub_strncasecmp): Add prototype.
547 * kern/misc.c (grub_strncasecmp): Add function.
549 2004-08-14 Marco Gerards <metgerards@student.han.nl>
551 * include/grub/arg.h (GRUB_ARG_OPTION_OPTIONAL): Surround macro
554 * fs/ext2.c (FILETYPE_UNKNOWN): New macro.
555 (grub_ext2_dir): In case the directory entry type is unknown, read
558 2004-08-02 Peter Bruin <pjbruin@dds.nl>
560 * loader/powerpc/ieee1275/linux.c (grub_linux_init): Pass
561 grub_load_linux instead of grub_rescue_cmd_linux as second
562 argument of grub_rescue_register_command.
564 * Makefile.in (RMKFILES): Add conf/powerpc-ieee1275.rmk.
566 2004-07-27 Marco Gerards <metgerards@student.han.nl>
568 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_release): New
570 * commands/boot.c: Remove the check for `GRUB_UTIL'.
571 * conf/powerpc-ieee1275.rmk (grubof_SOURCES): Add
572 `loader/powerpc/ieee1275/linux.c',
573 `loader/powerpc/ieee1275/linux_normal.c' and `commands/boot.c'.
574 * include/grub/powerpc/ieee1275/ieee1275.h
575 (grub_ieee1275_release): New prototype.
576 * include/grub/powerpc/ieee1275/loader.h: Rewritten.
577 * kern/powerpc/ieee1275/init.c (grub_machine_init): Initialize
578 normal, boot, linux and linux_normal.
579 * loader/powerpc/ieee1275/linux.c: New file.
580 * loader/powerpc/ieee1275/linux_normal.c: Likewise.
582 2004-07-12 Marco Gerards <metgerards@student.han.nl>
584 * normal/arg.c (grub_arg_parse): Correct error handling after
585 reallocating the argumentlist (check if `argl' is not null instead
586 of checking if `args' is not null).
587 * kern/mm.c (grub_realloc): Return the same pointer when using the
588 same region, instead of returning the header address.
590 2004-07-11 Marco Gerards <metgerards@student.han.nl>
592 * disk/powerpc/ieee1275/partition.c (grub_partition_iterate): Skip
593 one block instead of two when looking for the initial partition.
594 (grub_partition_probe): Initialize the local variable `p' with 0.
595 Use base 10 for the grub_strtoul call.
596 * kern/misc.c (grub_strncpy): Fix off by one bug. Eliminated the
597 need for one local variable.
598 (grub_strtoul): Don't add the new value to `num', instead of that
601 2004-07-11 Marco Gerards <metgerards@student.han.nl>
603 * conf/i386-pc.rmk (pkgdata_IMAGE): Add pxeboot.img.
604 (pxeboot_img_SOURCES): New variable.
605 (pxeboot_img_ASFLAGS): Likewise.
606 (pxeboot_img_LDFLAGS): Likewise.
607 * boot/i386/pc/pxeboot.S: New file. Based on pxeloader.S from
608 GRUB Legacy and boot.S. Adopted for GRUB 2 by lode leroy
609 <lode_leroy@hotmail.com>.
611 2004-06-27 Tomas Ebenlendr <ebik@ucw.cz>
613 * kern/rescue.c (grub_enter_rescue_mode): Don't continue when
616 2004-06-27 Tomas Ebenlendr <ebik@ucw.cz>
618 * normal/cmdline.c (grub_set_history): Fix off by one bug. Fixed
619 the history buffer logic.
621 2004-06-27 Tomas Ebenlendr <ebik@ucw.cz>
623 * fs/ext2.c (FILETYPE_INO_MASK, FILETYPE_INO_DIRECTORY)
624 (FILETYPE_INO_SYMLINK): New macros.
625 (grub_ext2_find_file): Check if the node is a directory using the
626 inode stat information instead of using the filetype in the
627 dirent. Exclude the first character of an absolute symlink.
628 (grub_ext2_dir): Mask out the filetype part of the mode member of
631 2004-05-24 Marco Gerards <metgerards@student.han.nl>
633 Add support for UFS version 1 and 2. Add support for the minix
634 filesystem version 1 and 2, both the variants with 14 and 30 long
637 * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/ufs.c and
639 (grub_emu_SOURCES): Likewise.
640 (pkgdata_MODULES): Add ufs.mod and minix.mod.
641 (ufs_mod_SOURCES): New variable.
642 (ufs_mod_CFLAGS): Likewise.
643 (minix_mod_SOURCES): Likewise.
644 (minix_mod_CFLAGS): Likewise.
645 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs/ufs.c and
647 (grubof_SOURCES): Likewise.
648 * fs/ufs.c: New file.
649 * fs/minix.c: New file.
650 * include/grub/fs.h (grub_ufs_init): New prototype.
651 (grub_ufs_fini): Likewise.
652 (grub_minix_init): Likewise.
653 (grub_minix_fini): Likewise.
654 * util/grub-emu.c (main): Initialize and deinitialize UFS and
657 2004-04-30 Jeroen Dekkers <jeroen@dekkers.cx>
659 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add normal/arg.c,
660 commands/ls.c, commands/terminal.c, commands/boot.c,
661 commands/cmp.c and commands/cat.c.
662 (grubof_LDFLAGS): Add -nostdlib -static-libgcc -lgcc.
664 * kern/powerpc/ieee1275/init.c: Include "grub/env.h" instead of
667 2004-04-04 Yoshinori K. Okuji <okuji@enbug.org>
669 All symbols prefixed with PUPA_ and pupa_ are renamed to GRUB_
670 and grub_, respectively. Because the conversion is trivial and
671 mechanical, I omit the details here. Please refer to the CVS
672 if you need more information.
674 2004-04-04 Yoshinori K. Okuji <okuji@enbug.org>
676 * include/pupa: Renamed to ...
677 * include/grub: ... this.
678 * util/i386/pc/pupa-mkimage.c: Renamed to ...
679 * util/i386/pc/grub-mkimage.c: ... this.
680 * util/i386/pc/pupa-setup.c: Renamed to ...
681 * util/i386/pc/grub-setup.c: ... this.
682 * util/pupa-emu.c: Renamed to ...
683 * util/grub-emu.c: ... this.
685 2004-03-29 Marco Gerards <metgerards@student.han.nl>
687 Add support for the newworld apple macintosh (PPC). This has been
688 tested on the powerbook 2000 only. It only adds support for
689 generic ieee1275 functions, console and disk support. This should
690 be easy to port to other architectures with support for Open
693 * configure.ac: Accept the powerpc as host_cpu. In the case of
694 the powerpc cpu set the host_vendor to ieee1275. Make sure the i386
695 specific tests are only executed while building for the i386.
696 Inverse test for crosscompile.
697 * genmk.rb (Utility): Allow assembler files.
698 * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno.
699 * conf/powerpc-ieee1275.rmk: New file.
700 * disk/powerpc/ieee1275/ofdisk.c: Likewise.
701 * disk/powerpc/ieee1275/partition.c: Likewise.
702 * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise.
703 * include/pupa/powerpc/ieee1275/console.h: Likewise.
704 * include/pupa/powerpc/ieee1275/partition.h: Likewise.
705 * include/pupa/powerpc/ieee1275/time.h: Likewise.
706 * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise.
707 * include/pupa/powerpc/ieee1275/multiboot.h: Likewise.
708 * include/pupa/powerpc/ieee1275/loader.h
709 * include/pupa/powerpc/setjmp.h: Likewise.
710 * include/pupa/powerpc/types.h: Likewise.
711 * kern/powerpc/ieee1275/init.c: Likewise.
712 * kern/powerpc/ieee1275/openfw.c: Likewise.
713 * term/powerpc/ieee1275/ofconsole.c: Likewise.
715 These files were written by Johan Rydberg
716 (jrydberg@night.trouble.net) and I only modified them slightly.
718 * boot/powerpc/ieee1275/cmain.c: New file.
719 * boot/powerpc/ieee1275/crt0.S: Likewise.
720 * boot/powerpc/ieee1275/ieee1275.c: Likewise.
721 * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
723 2004-03-14 Jeroen Dekkers <jeroen@dekkers.cx>
725 * Makefile.in: Update copyright.
726 * genmodsrc.sh: Likewise.
727 * gensymlist.sh: Likewise.
728 * term/i386/pc/vga.c: Indent correctly.
730 * util/i386/pc/pupa-mkimage.c (usage): Use PACKAGE_BUGREPORT as
731 bugreporting address.
732 * util/i386/pc/pupa-setup.c (usage): Likewise,
733 (main): Call pupa_ext2_init and pupa_ext2_fini.
735 * fs/fat.c (log2): Renamed to ...
736 (fat_log2): ... this.
738 * kern/misc.c (memcpy): Alias to pupa_memmove.
739 * loader/i386/pc/multiboot.c (pupa_rescue_cmd_multiboot): Fix
741 * util/console.c (pupa_ncurses_fini): Return 0.
743 * util/i386/pc/biosdisk.c (pupa_util_biosdisk_open)[__linux__]:
744 Move fail label here.
745 [__GNU__]: Don't warn when using stat.
746 (open_device)[!__linux__]: Check if FD < 0 instead of !FD.
747 (pupa_util_biosdisk_get_pupa_dev)[__GNU__]: Change type of N to
748 long int. Use strtol instead of strtoul.
750 2004-03-14 Marco Gerards <metgerards@student.han.nl>
752 * commands/boot.c: New file.
753 * commands/cat.c: Likewise.
754 * commands/cmp.c: Likewise.
755 * commands/ls.c: Likewise.
756 * commands/terminal.c: Likewise.
757 * normal/command.c: Include <pupa/env.h> and <pupa/dl.h>.
758 (pupa_register_command): Changed interface to match the new
760 (pupa_command_execute): Changed (almost rewritten) so it uses
761 pupa_split_command. Added support for setting variables using the
763 (rescue_command): Changed to work with the new argument parser.
764 (terminal_command): Moved from here to commands/terminal.c.
765 (set_command): New function.
766 (unset_command): New function.
767 (insmod_command): New function.
768 (rmmod_command): New function.
769 (lsmod_command): New function.
770 (pupa_command_init): Don't initialize the command terminal
771 anymore. Initialize the commands set, unset, insmod, rmmod and
773 * conf/i386-pc.rmk (kernel_img_SOURCES): Add kern/env.c.
774 (kernel_img_HEADERS): Add arg.h and env.h.
775 (pupa_mkimage_LDFLAGS): Add kern/env.c.
776 (pupa_emu_SOURCES): Add kern/env.c, commands/ls.c,
777 commands/terminal.c commands/boot.c commands/cmp.c commands/cat.c,
779 (pkgdata_MODULES): Add ls.mod, boot.mod, cmp.mod, cat.mod and
781 (normal_mod_SOURCES): Add normal/arg.c and normal/arg.c.
782 (boot_mod_SOURCES): New variable.
783 (terminal_mod_SOURCES): Likewise.
784 (ls_mod_SOURCES): Likewise.
785 (cmp_mod_SOURCES): Likewise.
786 (cat_mod_SOURCES): Likewise.
788 * normal/arg.c: New file.
789 * kern/env.c: Likewise.
790 * include/pupa/arg.h: Likewise.
791 * include/pupa/env.h: Likewise.
792 * font/manager.c (font_command): Changed to match argument parsing
794 (PUPA_MOD_INIT): Likewise.
795 * hello/hello.c (pupa_cmd_hello): Likewise.
796 (PUPA_MOD_INIT): Likewise.
797 * include/pupa/disk.h: Include <pupa/device.h>.
798 (pupa_print_partinfo): New prototype.
799 * include/pupa/dl.h (pupa_dl_set_prefix): Prototype removed.
800 (pupa_dl_get_prefix): Likewise.
801 * include/pupa/misc.h: Include <pupa/err.h>.
802 (pupa_isgraph): New prototype.
803 (pupa_isdigit): Likewise.
804 (pupa_split_cmdline): Likewise.
805 * include/pupa/normal.h: Include <pupa/arg.h>.
806 (pupa_command): Changed the prototype of the member `func' to
807 match the argument parsing interface. Added member `options'.
808 (pupa_register_command): Updated to match function.
809 (pupa_arg_parse): New prototype.
810 (pupa_hello_init) [PUPA_UTIL]: New prototype.
811 (pupa_hello_fini) [PUPA_UTIL]: Likewise.
812 (pupa_ls_init) [PUPA_UTIL]: Likewise.
813 (pupa_ls_fini) [PUPA_UTIL]: Likewise.
814 (pupa_cat_init) [PUPA_UTIL]: Likewise.
815 (pupa_cat_fini) [PUPA_UTIL]: Likewise.
816 (pupa_boot_init) [PUPA_UTIL]: Likewise.
817 (pupa_boot_fini) [PUPA_UTIL]: Likewise.
818 (pupa_cmp_init) [PUPA_UTIL]: Likewise.
819 (pupa_cmp_fini) [PUPA_UTIL]: Likewise.
820 (pupa_terminal_init) [PUPA_UTIL]: Likewise.
821 (pupa_terminal_fini) [PUPA_UTIL]: Likewise.
822 * kern/disk.c: Include <pupa/file.h>.
823 (pupa_print_partinfo): New function.
824 * kern/dl.c: Include <pupa/env.h>.
825 (pupa_dl_dir): Variable removed.
826 (pupa_dl_load): Use the environment variable `prefix' instead of
827 the variable pupa_dl_dir.
828 (pupa_dl_set_prefix): Function removed.
829 (pupa_dl_get_prefix): Likewise.
830 * kern/i386/pc/init.c: Include <pupa/env.h>.
831 (pupa_machine_init): Use the environment variable `prefix' instead of
832 using pupa_dl_set_prefix to set the prefix.
833 * kern/main.c: Include <pupa/env.h>.
834 (pupa_set_root_dev): Use the environment variable `prefix' instead of
835 using pupa_dl_get_prefix to get the prefix.
836 * kern/misc.c: Include <pupa/env.h>.
837 (pupa_isdigit): New function.
838 (pupa_isgraph): Likewise.
839 (pupa_ftoa): Likewise.
840 (pupa_vsprintf): Added support for printing values of the type
841 `double'. Make it possible to format variable output when using
842 formatting like `%1.2%f'.
843 (pupa_split_cmdline): New function.
844 * kern/rescue.c: Include <pupa/env.h>.
845 (next_word): Removed function.
846 (pupa_rescue_cmd_prefix): Likewise.
847 (pupa_rescue_cmd_set): New function.
848 (pupa_rescue_cmd_unset): New function.
849 (pupa_enter_rescue_mode): Use the `pupa_split_cmdline' function to
850 split the command line instead of splitting it here. Added
851 support for setting variables using the syntax `foo=bar'. Don't
852 initialize the prefix command anymore. Initialized the set and
854 * normal/cmdline.c: Include <pupa/env.h>.
855 (pupa_tab_complete): Added prototypes for print_simple_completion,
856 print_partition_completion, add_completion, iterate_commands,
857 iterate_dev, iterate_part and iterate_dir. Moved code to print
858 partition information from here to kern/disk.c.
859 (pupa_cmdline_run): Don't check if the funtion exists anymore.
860 * normal/main.c: Include <pupa/env.h>.
861 (pupa_rescue_cmd_normal): Use the environment variable `prefix'
862 instead of using pupa_dl_get_prefix to get the prefix.
863 * term/i386/pc/vga.c: Include <pupa/arg.h>.
864 (check_vga_mem): Cast pointers to `void *' to silence a gcc
866 (pupa_vga_putchar) [! DEBUG_VGA]: Removed for this case.
867 (pupa_vga_setcolor): Declare unused variables with `__attribute__
868 ((unused))' to silence a gcc warning.
869 (pupa_vga_setcolor): Likewise.
870 (debug_command): Changed to match argument parsing
872 * util/pupa-emu.c: Include <pupa/env.h>.
873 (options): Added 0's for unused fields to silence a gcc warning.
875 (main): Use the environment variable `prefix' instead of using
876 pupa_dl_set_prefix to set the prefix. Initialize the commands ls,
877 boot, cmp, cat and terminal. Finish the commands boot, cmp, cat
880 * util/i386/pc/getroot.c: Include <pupa/i386/pc/util/biosdisk.h>.
881 * util/misc.c: Include <malloc.h>.
882 (pupa_malloc): Rewritten so errors are correctly reported.
883 (pupa_realloc): Likewise.
884 (pupa_memalign): Likewise.
885 (pupa_mm_init_region): Declare unused variables with
886 `__attribute__ ((unused))' to silence a gcc warning.
887 * normal/i386/setjmp.S: Remove tab at the end of the file to
888 silence a gcc warning.
889 * loader/i386/pc/linux.c (pupa_rescue_cmd_initrd): Declare unused
890 variables with `__attribute__ ((unused))' to silence a gcc
892 * loader/i386/pc/multiboot.c (pupa_multiboot_unload): Make the
893 local variable i unsigned to silence a gcc warning.
895 * kern/term.c: Include <pupa/misc.h>.
896 (pupa_more_lines): New variable.
897 (pupa_more): Likewise.
898 (pupa_putcode): When the pager is active pause at the end of every
900 (pupa_set_more): New function.
901 * include/pupa/term.h (pupa_set_more): New prototype.
904 2004-03-07 Yoshinori K. Okuji <okuji@enbug.org>
906 Now this project is GRUB 2 rather than PUPA. The location of
907 the CVS repository was moved to GRUB's.
909 * configure.ac: Use bug-grub as the reporting address.
910 Use GRUB instead of PUPA.
911 Change the version number to 1.90.
913 2004-02-24 Yoshinori K. Okuji <okuji@enbug.org>
915 * genkernsyms.sh: Updated copyright information.
916 * genmk.rb: Likewise.
917 * genmodsrc.sh: Likewise.
918 * gensymlist.sh: Likewise.
919 * boot/i386/pc/boot.S: Likewise.
920 * boot/i386/pc/diskboot.S: Likewise.
921 * disk/i386/pc/biosdisk.c: Likewise.
922 * disk/i386/pc/partition.c: Likewise.
923 * font/manager.c: Likewise.
924 * fs/ext2.c: Likewise.
925 * fs/fat.c: Likewise.
926 * include/pupa/boot.h: Likewise.
927 * include/pupa/device.h: Likewise.
928 * include/pupa/disk.h: Likewise.
929 * include/pupa/dl.h: Likewise.
930 * include/pupa/elf.h: Likewise.
931 * include/pupa/err.h: Likewise.
932 * include/pupa/file.h: Likewise.
933 * include/pupa/font.h: Likewise.
934 * include/pupa/fs.h: Likewise.
935 * include/pupa/kernel.h: Likewise.
936 * include/pupa/loader.h: Likewise.
937 * include/pupa/misc.h: Likewise.
938 * include/pupa/mm.h: Likewise.
939 * include/pupa/net.h: Likewise.
940 * include/pupa/normal.h: Likewise.
941 * include/pupa/rescue.h: Likewise.
942 * include/pupa/setjmp.h: Likewise.
943 * include/pupa/symbol.h: Likewise.
944 * include/pupa/term.h: Likewise.
945 * include/pupa/types.h: Likewise.
946 * include/pupa/i386/setjmp.h: Likewise.
947 * include/pupa/i386/types.h: Likewise.
948 * include/pupa/i386/pc/biosdisk.h: Likewise.
949 * include/pupa/i386/pc/boot.h: Likewise.
950 * include/pupa/i386/pc/console.h: Likewise.
951 * include/pupa/i386/pc/init.h: Likewise.
952 * include/pupa/i386/pc/kernel.h: Likewise.
953 * include/pupa/i386/pc/linux.h: Likewise.
954 * include/pupa/i386/pc/loader.h: Likewise.
955 * include/pupa/i386/pc/memory.h: Likewise.
956 * include/pupa/i386/pc/multiboot.h: Likewise.
957 * include/pupa/i386/pc/partition.h: Likewise.
958 * include/pupa/i386/pc/time.h: Likewise.
959 * include/pupa/i386/pc/vga.h: Likewise.
960 * include/pupa/i386/pc/util/biosdisk.h: Likewise.
961 * include/pupa/util/getroot.h: Likewise.
962 * include/pupa/util/misc.h: Likewise.
963 * include/pupa/util/resolve.h: Likewise.
964 * kern/device.c: Likewise.
965 * kern/disk.c: Likewise.
966 * kern/dl.c: Likewise.
967 * kern/err.c: Likewise.
968 * kern/file.c: Likewise.
969 * kern/fs.c: Likewise.
970 * kern/loader.c: Likewise.
971 * kern/main.c: Likewise.
972 * kern/misc.c: Likewise.
973 * kern/mm.c: Likewise.
974 * kern/rescue.c: Likewise.
975 * kern/term.c: Likewise.
976 * kern/i386/dl.c: Likewise.
977 * kern/i386/pc/init.c: Likewise.
978 * kern/i386/pc/lzo1x.S: Likewise.
979 * kern/i386/pc/startup.S: Likewise.
980 * loader/i386/pc/chainloader.c: Likewise.
981 * loader/i386/pc/linux.c: Likewise.
982 * loader/i386/pc/multiboot.c: Likewise.
983 * normal/cmdline.c: Likewise.
984 * normal/command.c: Likewise.
985 * normal/main.c: Likewise.
986 * normal/menu.c: Likewise.
987 * normal/i386/setjmp.S: Likewise.
988 * term/i386/pc/console.c: Likewise.
989 * term/i386/pc/vga.c: Likewise.
990 * util/console.c: Likewise.
991 * util/genmoddep.c: Likewise.
992 * util/misc.c: Likewise.
993 * util/pupa-emu.c: Likewise.
994 * util/resolve.c: Likewise.
995 * util/unifont2pff.rb: Likewise.
996 * util/i386/pc/biosdisk.c: Likewise.
997 * util/i386/pc/getroot.c: Likewise.
998 * util/i386/pc/pupa-mkimage.c: Likewise.
999 * util/i386/pc/pupa-setup.c: Likewise.
1001 2004-02-15 Jeroen Dekkers <jeroen@dekkers.cx>
1003 * fs/ext2.c (pupa_ext2_read_file): Correct the value of BLOCKEND
1004 when it is EXT2_BLOCK_SIZE (data). New argument READ_HOOK, all
1005 callers changed. Set DATA->DISK->READ_HOOK to READ_HOOK before
1006 reading and reset it after reading.
1007 (pupa_ext2_close): Return PUPA_ERR_NONE.
1009 * include/pupa/i386/pc/linux.h (PUPA_LINUX_INITRD_MAX_ADDRESS):
1011 (struct linux_kernel_header): Add kernel_version and
1013 * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Check whether
1014 pupa_file_read succeeds.
1015 (pupa_rescue_cmd_initrd): Implement.
1017 2003-12-03 Marco Gerards <metgerards@student.han.nl>
1019 * fs/ext2.c (pupa_ext2_label): New function.
1020 (pupa_ext2_fs): Added label.
1021 * fs/fat.c (pupa_fat_label): New function.
1022 (pupa_fat_fs): Added label.
1023 * include/pupa/fs.h (struct pupa_fs): Added prototype label.
1025 * kern/misc.c (pupa_strndup): New function.
1026 * include/pupa/misc.h (pupa_strndup): New prototype.
1028 * include/pupa/normal.h: Include <pupa/err.h>.
1029 (pupa_set_history): New prototype.
1030 (pupa_iterate_commands): New prototype.
1031 * normal/cmdline.c: Include <pupa/machine/partition.h>,
1032 <pupa/disk.h>, <pupa/file.h>.
1033 (hist_size): New variable.
1034 (hist_lines): Likewise.
1035 (hist_end): Likewise.
1036 (hist_used): Likewise.
1037 (pupa_set_history): New function.
1038 (pupa_history_get): Likewise.
1039 (pupa_history_add): Likewise.
1040 (pupa_history_replace): Likewise.
1041 (pupa_tab_complete): Likewise.
1042 (pupa_cmdline_run): Added tab completion and history buffer. Tab
1043 completion shows partitionnames while completing partitions, this
1044 feature was suggested by Jeff Bailey.
1045 * normal/command.c (pupa_iterate_commands): New function.
1046 * normal/main.c (PUPA_DEFAULT_HISTORY_SIZE): New macro.
1047 (pupa_normal_init): Initialize history buffer.
1048 (PUPA_MOD_INIT): Likewise.
1049 (pupa_normal_fini): Free the history buffer.
1050 (PUPA_MOD_FINI): Likewise.
1052 * util/console.c (pupa_ncurses_getkey): Accept 127 as backspace
1055 * aclocal.m4 (pupa_I386_CHECK_REGPARM_BUG): New DEFUN.
1056 * configure.ac [i386]: Check for regparam bug.
1057 (NESTED_FUNC_ATTR) [! i386]: Defined.
1059 2003-11-17 Marco Gerards <metgerards@student.han.nl>
1061 * conf/i386-pc.rmk (sbin_UTILITIES): Added pupa-emu.
1062 (pupa_setup_SOURCES): Added util/i386/pc/getroot.c.
1063 (pupa_emu_SOURCES): New variable.
1064 (pupa_emu_LDFLAGS): Likewise.
1065 * include/pupa/fs.h (pupa_ext2_init) [PUPA_UTIL]: New prototype.
1066 (pupa_ext2_fini) [PUPA_UTIL]: Likewise.
1067 * include/pupa/normal.h (pupa_normal_init) [PUPA_UTIL]: Likewise.
1068 (pupa_normal_fini) [PUPA_UTIL]: Likewise.
1069 * include/pupa/setjmp.h [PUPA_UTIL]: Include <setjmp.h>.
1070 (pupa_jmp_buf): New typedef.
1071 (pupa_setjmp) [PUPA_UTIL]: New macro.
1072 (pupa_longjmp) [PUPA_UTIL]: Likewise.
1073 * include/pupa/term.h (struct pupa_term): New member `refresh'.
1074 (pupa_refresh): New prototype.
1075 * include/pupa/util/getroot.h: New file.
1076 * kern/misc.c (pupa_vsprintf): Refresh the screen after updating
1078 * kern/rescue.c (pupa_rescue_get_command_line): Likewise.
1079 (pupa_rescue_cmd_cat): Likewise.
1080 (pupa_rescue_cmd_ls): Likewise.
1081 (pupa_rescue_cmd_testload): Likewise.
1082 (pupa_rescue_cmd_lsmod): Likewise.
1083 * normal/cmdline.c (pupa_cmdline_get): Likewise.
1084 * normal/menu.c (run_menu): Likewise.
1085 * kern/term.c (pupa_cls): Likewise.
1086 (pupa_refresh): New function.
1087 * normal/normal.c (pupa_normal_init) [PUPA_UTIL]: New function.
1088 (pupa_normal_fini) [PUPA_UTIL]: Likewise.
1089 * util/console.c: New file.
1091 * util/i386/pc/getroot.c: New file.
1092 * util/i386/pc/pupa-setup.c: Include <pupa/util/getroot.h>.
1093 (pupa_putchar): New function.
1094 (pupa_refresh): Likewise.
1095 (xgetcwd): Function moved to ...
1096 (strip_extra_slashes): Likewise.
1097 (get_prefix): Likewise.
1098 * util/i386/pc/getroot.c: ... here.
1099 (find_root_device): Function moved and renamed to...
1100 * util/i386/pc/getroot.c (pupa_find_root_device): ... here.
1101 Changed all callers.
1102 * util/i386/pc/pupa-setup.c (guess_root_device): Function moved
1104 * util/i386/pc/getroot.c (pupa_guess_root_device): ... here.
1105 Changed all callers.
1106 * util/misc.c (pupa_memalign): New function.
1107 (pupa_mm_init_region): Likewise.
1108 (pupa_register_exported_symbols): Likewise.
1109 (pupa_putchar): Function removed.
1110 * util/pupa-emu.c: New file.
1112 2003-11-16 Jeroen Dekkers <jeroen@dekkers.cx>
1114 * conf/i386-pc.rmk (pkgdata_MODULES): Add _multiboot.mod.
1115 (_multiboot_mod_SOURCES): New variable.
1116 (_multiboot_mod_CFLAGS): Likewise.
1117 * loader/i386/pc/multiboot.c: New file.
1118 * include/pupa/i386/pc/multiboot.h: Likewise.
1119 * kern/i386/pc/startup.S: Include pupa/machine/multiboot.h.
1120 (pupa_multiboot_real_boot): New function.
1121 * include/pupa/i386/pc/loader.h: Include pupa/machine/multiboot.h.
1122 (pupa_multiboot_real_boot): New prototype.
1123 (pupa_rescue_cmd_multiboot): Likewise
1124 (pupa_rescue_cmd_module): Likewise.
1126 * kern/loader.c (pupa_loader_set): Continue when
1127 pupa_loader_unload_func() fails.
1128 (pupa_loader_unset): New function.
1129 * include/pupa/loader.h (pupa_loader_unset): New prototype.
1131 * kern/misc.c (pupa_stpcpy): New function.
1132 * include/pupa/misc.h (pupa_stpcpy): New prototype.
1134 2003-11-12 Marco Gerards <metgerards@student.han.nl>
1136 * disk/i386/pc/biosdisk.c (pupa_biosdisk_open): Correctly check
1137 for available extensions.
1139 * include/pupa/i386/pc/time.h: New file.
1140 * kern/disk.c: Include <pupa/machine/time.h>.
1141 (PUPA_CACHE_TIMEOUT): New macro.
1142 (pupa_last_time): New variable.
1143 (pupa_disk_open): Flush the cache when there was a timeout.
1144 (pupa_disk_close): Reset the timer.
1145 * kern/i386/pc/startup.S (pupa_get_rtc): Renamed from
1147 * util/misc.c: Include <sys/times.h>
1148 (pupa_get_rtc): New function.
1150 2003-11-09 Jeroen Dekkers <jeroen@dekkers.cx>
1152 * fs/ext2.c (struct pupa_ext2_inode): Declare struct datablocks
1154 (pupa_ext2_get_file_block): Use blocks member.
1156 * fs/ext2.c (pupa_ext2_read_file): Only set skipfirst for the
1157 first block. Return -1 instead of pupa_errno on error.
1159 2003-10-27 Marco Gerards <metgerards@student.han.nl>
1161 * README: In the pupa-mkimage example use _chain instead of chain
1162 and ext2 instead of fat.
1163 * TODO: Replace ext2fs with jfs as an example. Add an item for
1164 adding journal playback for ext2fs.
1165 * conf/i386-pc.rmk (pupa_setup_SOURCES): Added fs/ext2.c.
1166 (pkgdata_MODULES): Added ext2.mod.
1167 (ext2_mod_SOURCES): New variable.
1168 (ext2_mod_CFLAGS): Likewise.
1169 * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_SYMLINK_LOOP.
1170 * include/pupa/misc.h (pupa_strncpy): New prototype.
1171 (pupa_strcat): Likewise.
1172 (pupa_strncmp): Likewise.
1173 * kern/misc.c (pupa_strcat): Enable function.
1174 (pupa_strncpy): New function.
1175 (pupa_strncmp): Likewise.
1176 * fs/ext2.c: New file.
1178 * kern/disk.c (pupa_disk_read): Set pupa_errno to PUPA_ERR_NONE
1179 when the read failed before retrying.
1180 * util/i386/pc/biosdisk.c (_LARGEFILE_SOURCE): Removed.
1181 (_FILE_OFFSET_BITS): Likewise.
1182 * configure.ac: Added AC_SYS_LARGEFILE.
1184 2003-09-25 Yoshinori K. Okuji <okuji@enbug.org>
1186 * genmk.rb (PModule#rule): Make sure to get only symbol names
1187 from the output of nm.
1188 Reported by Robert Millan <zeratul2@wanadoo.es>.
1190 2003-09-25 Yoshinori K. Okuji <okuji@enbug.org>
1192 I forgot to check in these changes for a long time. This adds
1193 incomplete support for VGA console, and this is still very
1194 buggy. Also, a lot of consideration is required for I18N,
1195 UNICODE, and VGA font issues. Therefore, assume that this is
1196 such that "better than nothing".
1198 * font/manager.c: New file.
1199 * include/pupa/font.h: Likewise.
1200 * include/pupa/i386/pc/vga.h: Likewise.
1201 * term/i386/pc/vga.c: Likewise.
1202 * util/unifont2pff.rb: Likewise.
1204 * conf/i386-pc.rmk (kernel_img_HEADERS): Added machine/vga.h.
1205 (pkgdata_MODULES): Added vga.mod and font.mod.
1206 (vga_mod_SOURCES): New variables.
1207 (vga_mod_CFLAGS): Likewise.
1208 (font_mod_SOURCES): Likewise.
1209 (font_mod_CFLAGS): Likewise.
1211 * include/pupa/err.h (PUPA_ERR_BAD_FONT): New constant.
1213 * include/pupa/term.h: Include pupa/err.h.
1214 (struct pupa_term): Added init and fini.
1215 Changed the argument of putchar to pupa_uint32_t.
1217 * include/pupa/i386/pc/console.h: Include pupa/symbol.h.
1218 (pupa_console_real_putchar): New prototype.
1219 (pupa_console_putchar): Removed.
1220 (pupa_console_checkkey): Exported.
1221 (pupa_console_getkey): Likewise.
1223 * kern/misc.c (pupa_vsprintf): Add support for UNICODE
1226 * kern/term.c (pupa_term_set_current): Rewritten.
1227 (pupa_putchar): Likewise.
1228 (pupa_putcode): New function.
1230 * kern/i386/pc/startup.S (pupa_console_putchar): Renamed to ...
1231 (pupa_console_real_putchar): ... this.
1232 (pupa_vga_set_mode): New function.
1233 (pupa_vga_get_font): Likewise.
1235 * normal/command.c: Include pupa/term.h.
1236 (terminal_command): New function.
1237 (pupa_command_init): Register the command "terminal".
1239 * normal/menu.c (DISP_LEFT): Changed to a UNICODE value.
1240 (DISP_UP): Likewise.
1241 (DISP_RIGHT): Likewise.
1242 (DISP_DOWN): Likewise.
1243 (DISP_HLINE): Likewise.
1244 (DISP_VLINE): Likewise.
1245 (DISP_UL): Likewise.
1246 (DISP_UR): Likewise.
1247 (DISP_LL): Likewise.
1248 (DISP_LR): Likewise.
1250 * term/i386/pc/console.c (pupa_console_putchar): New function.
1252 2003-02-08 NIIBE Yutaka <gniibe@m17n.org>
1254 * util/resolve.c (pupa_util_resolve_dependencies): BUG
1255 FIX. Reverse the path_list.
1257 * include/pupa/normal.h: Export pupa_register_command and
1258 pupa_unregister_command.
1260 * hello/hello.c (pupa_cmd_hello): New module.
1261 * conf/i386-pc.rmk: Added hello.mod.
1263 2003-01-31 Yoshinori K. Okuji <okuji@enbug.org>
1265 * kern/i386/pc/lzo1x.S: New file.
1267 * util/i386/pc/pupa-mkimage.c: Include lzo1x.h.
1268 (compress_kernel): New variable.
1269 (generate_image): Heavily modified to support compressing a
1270 large part of the core image.
1272 * util/misc.c (pupa_util_read_image): Fix a file descriptor
1274 (pupa_util_load_image): New function.
1276 * kern/i386/pc/startup.S: Include pupa/machine/kernel.h.
1277 (pupa_compressed_size): New variable.
1278 (codestart): Enable Gate A20 here.
1279 Decompress the compressed part of the core image.
1280 Rearrange the code to put functions and variables which are
1281 required for initialization in the non-compressed part.
1284 * kern/i386/pc/init.c (pupa_machine_init): Don't enable Gate A20
1287 * include/pupa/util/misc.h (pupa_util_write_image): Declared.
1289 * include/pupa/i386/pc/kernel.h
1290 (PUPA_KERNEL_MACHINE_COMPRESSED_SIZE): New macro.
1291 (PUPA_KERNEL_MACHINE_INSTALL_DOS_PART): Increased by 4.
1292 (PUPA_KERNEL_MACHINE_INSTALL_BSD_PART): Likewise.
1293 (PUPA_KERNEL_MACHINE_PREFIX): Likewise.
1294 (PUPA_KERNEL_MACHINE_RAW_SIZE): New macro.
1296 * conf/i386-pc.rmk (pupa_mkimage_LDFLAGS): New variable.
1298 * genmk.rb (Image#rule): Put LDFLAGS at the end of a line.
1299 (Utility#rule): Likewise.
1301 * configure.ac: Check if LZO is available.
1303 2003-01-20 Yoshinori K. Okuji <okuji@enbug.org>
1305 * include/pupa/normal.h: New file.
1306 * include/pupa/setjmp.h: Likewise.
1307 * include/pupa/i386/setjmp.h: Likewise.
1308 * normal/cmdline.c: Likewise.
1309 * normal/command.c: Likewise.
1310 * normal/main.c: Likewise.
1311 * normal/menu.c: Likewise.
1312 * normal/i386/setjmp.S: Likewise.
1314 * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global.
1315 (pupa_rescue_cmd_initrd): Likewise.
1317 * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader):
1320 * kern/i386/pc/startup.S (translation_table): New variable.
1321 (translate_keycode): New function.
1322 (pupa_console_getkey): Call translate_keycode.
1324 * kern/rescue.c (attempt_normal_mode): New function.
1325 (pupa_enter_rescue_mode): Attempt to execute the normal mode. If
1326 it failed, print a message.
1328 * kern/mm.c (pupa_real_malloc): Print more information when a
1329 free magic is broken.
1330 (pupa_free): If the first free header is not free actually, set
1333 * kern/main.c (pupa_load_normal_mode): Just load the module
1335 (pupa_main): Don't print the message
1336 "Entering into rescue mode..." here.
1338 * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd):
1340 (pupa_rescue_cmd_initrd): Likewise.
1341 (pupa_rescue_cmd_initrd): Likewise.
1343 * include/pupa/symbol.h (FUNCTION): Specify the type.
1344 (VARIABLE): Likewise.
1346 * include/pupa/err.h (pupa_err_t): Added
1347 PUPA_ERR_UNKNOWN_COMMAND.
1349 * include/pupa/dl.h (pupa_dl_set_prefix): Exported.
1350 (pupa_dl_get_prefix): Likewise.
1352 * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod.
1353 Added _chain.mod and _linux.mod instead of chain.mod and
1355 (chain_mod_SOURCES): Renamed to ...
1356 (_chain_mod_SOURCES): ... this.
1357 (chain_mod_CFLAGS): Renamed to ...
1358 (_chain_mod_CFLAGS): ... this.
1359 (linux_mod_SOURCES): Renamed to ...
1360 (_linux_mod_SOURCES): ... this.
1361 (linux_mod_CFLAGS): Renamed to ...
1362 (_linux_mod_CFLAGS): ... this.
1363 (normal_mod_SOURCES): New variable.
1364 (normal_mod_CFLAGS): Likewise.
1365 (normal_mod_ASFLAGS): Likewise.
1367 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org>
1369 * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if
1372 * kern/dl.c (pupa_dl_ref): Refer dependending modules
1374 (pupa_dl_unref): Unrefer depending modules recursively.
1375 Don't call pupa_dl_unload implicitly, because PUPA can crash if
1376 a module is unloaded before one depending on that module is
1378 (pupa_dl_unload): Unload depending modules explicitly,
1381 2003-01-17 Yoshinori K. Okuji <okuji@enbug.org>
1383 * include/pupa/i386/pc/linux.h: New file.
1384 * loader/i386/pc/linux.c: Likewise.
1386 * loader/i386/pc/chainloader.c (pupa_chainloader_boot_sector):
1388 (pupa_chainloader_unload): Return PUPA_ERR_NONE.
1389 (pupa_rescue_cmd_chainloader): Read the image to 0x7C00 instead
1390 of PUPA_CHAINLOADER_BOOT_SECTOR.
1392 * kern/i386/pc/startup.S: Include pupa/machine/linux.h.
1393 (pupa_linux_prot_size): New variable.
1394 (pupa_linux_tmp_addr): Likewise.
1395 (pupa_linux_real_addr): Likewise.
1396 (pupa_linux_boot_zimage): New function.
1397 (pupa_linux_boot_bzimage): Likewise.
1399 * kern/i386/pc/init.c (struct mem_region): New structure.
1400 (MAX_REGIONS): New macro.
1401 (mem_regions): New variable.
1402 (num_regions): Likewise.
1403 (pupa_os_area_addr): Likewise.
1404 (pupa_os_area_size): Likewise.
1405 (pupa_lower_mem): Likewise.
1406 (pupa_upper_mem): Likewise.
1407 (add_mem_region): New function.
1408 (compact_mem_regions): Likewise.
1409 (pupa_machine_init): Set PUPA_LOWER_MEM and PUPA_UPPER_MEM to
1410 the size of the conventional memory and that of so-called upper
1411 memory (before the first memory hole).
1412 Instead of adding each found region to free memory, use
1413 add_mem_region and add them after removing overlaps.
1414 Also, add only 1/4 of the upper memory to free memory. The rest
1415 is used for loading OS images. Maybe this is ad hoc, but this
1416 makes it much easier to relocate OS images when booting.
1418 * kern/rescue.c (pupa_rescue_cmd_module): Removed.
1419 (pupa_enter_rescue_mode): Don't register initrd and module.
1421 * kern/mm.c: Include pupa/dl.h.
1423 * kern/main.c: Include pupa/file.h and pupa/device.h.
1425 * kern/loader.c (pupa_loader_load_module_func): Removed.
1426 (pupa_loader_load_module): Likewise.
1428 * kern/dl.c (pupa_dl_load): Use the suffix ``.mod'' instead of
1431 * include/pupa/i386/pc/loader.h (pupa_linux_prot_size): Declared.
1432 (pupa_linux_tmp_addr): Likewise.
1433 (pupa_linux_real_addr): Likewise.
1434 (pupa_linux_boot_zimage): Likewise.
1435 (pupa_linux_boot_bzimage): Likewise.
1437 * include/pupa/i386/pc/init.h (pupa_lower_mem): Declared.
1438 (pupa_upper_mem): Likewise.
1439 (pupa_gate_a20): Don't export, because turning off Gate A20 in a
1440 module is too dangerous.
1442 * include/pupa/loader.h (pupa_os_area_addr): Declared.
1443 (pupa_os_area_size): Likewise.
1444 (pupa_loader_set): Remove the first argument. Loader doesn't
1445 manage modules or initrd any longer.
1446 (pupa_loader_load_module): Removed.
1448 * conf/i386-pc.rmk (pkgdata_MODULES): Added linux.mod.
1449 (linux_mod_SOURCES): New variable.
1450 (linux_mod_CFLAGS): Likewise.
1452 2003-01-07 Yoshinori K. Okuji <okuji@enbug.org>
1454 * util/i386/pc/pupa-setup.c (setup): Convert the endianness of
1455 the length of a blocklist correctly.
1457 * util/i386/pc/biosdisk.c (pupa_util_biosdisk_open) [__linux__]:
1458 Use ioctl only if the OS file is a block device.
1459 (pupa_util_biosdisk_open): Don't use ST.ST_BLOCKS, because it is
1460 not very useful for normal files.
1462 * kern/main.c (pupa_set_root_dev): New function.
1463 (pupa_load_normal_mode): Likewise.
1464 (pupa_main): Call those above.
1466 * include/pupa/types.h (pupa_swap_bytes16): Cast the result to
1469 * include/pupa/kernel.h (pupa_enter_normal_mode): Removed.
1471 2003-01-06 Yoshinori K. Okuji <okuji@enbug.org>
1473 * util/i386/pc/pupa-setup.c: Include pupa/machine/kernel.h.
1474 (setup): Configure the installed partition information and the
1477 * loader/i386/pc/chainloader.c (my_mod): New variable.
1478 (pupa_chainloader_unload): New function.
1479 (pupa_rescue_cmd_chainloader): Refer itself.
1480 (PUPA_MOD_INIT): Save its own module in MY_MOD.
1482 * kern/i386/pc/startup.S (install_partition): Removed.
1483 (version_string): Likewise.
1484 (config_file): Likewise.
1485 (pupa_install_dos_part): New variable.
1486 (pupa_install_bsd_part): Likewise.
1487 (pupa_prefix): Likewise.
1488 (pupa_chainloader_real_boot): Call pupa_dl_unload_all.
1490 * kern/i386/pc/init.c: Include pupa/machine/kernel.h, pupa/dl.h
1492 (make_install_device): New function.
1493 (pupa_machine_init): Set the dl prefix.
1495 * kern/rescue.c: Include pupa/rescue.h and pupa/dl.h.
1496 (buf): Renamed to ...
1497 (linebuf): ... this.
1498 (pupa_rescue_cmd_prefix): New function.
1499 (pupa_rescue_cmd_insmod): Likewise.
1500 (pupa_rescue_cmd_rmmod): Likewise.
1501 (pupa_rescue_cmd_lsmod): Likewise.
1502 (pupa_enter_rescue_mode): Register new commands: prefix, insmod,
1505 * kern/mm.c (pupa_memalign): If failed even after invalidating
1506 disk caches, unload unneeded modules and retry.
1508 * kern/misc.c (pupa_memmove): New function.
1509 (pupa_memcpy): Removed.
1510 (pupa_strcpy): New function.
1511 (pupa_itoa): Made static.
1513 * kern/dl.c (pupa_dl_iterate): New function.
1514 (pupa_dl_ref): Likewise.
1515 (pupa_dl_unref): Likewise.
1516 (pupa_dl_unload): Return if succeeded or not.
1517 (pupa_dl_unload_unneeded): New function.
1518 (pupa_dl_unload_all): Likewise.
1519 (pupa_dl_init): Renamed to ...
1520 (pupa_dl_set_prefix): ... this.
1521 (pupa_dl_get_prefix): New function.
1523 * include/pupa/i386/pc/kernel.h: Include pupa/types.h.
1524 (PUPA_KERNEL_MACHINE_INSTALL_DOS_PART): New macro.
1525 (PUPA_KERNEL_MACHINE_INSTALL_BSD_PART): Likewise.
1526 (PUPA_KERNEL_MACHINE_PREFIX): Likewise.
1527 (pupa_install_dos_part): Declared.
1528 (pupa_install_bsd_part): Likewise.
1529 (pupa_prefix): Likewise.
1530 (pupa_boot_drive): Likewise.
1532 * include/pupa/types.h: Fix a typo.
1534 * include/pupa/misc.h (pupa_memcpy): New macro. Just an alias to
1536 (pupa_memmove): Declared.
1537 (pupa_strcpy): Likewise.
1539 * include/pupa/dl.h (PUPA_MOD_INIT): Change the prototype. Now
1540 pupa_mod_init takes one argument, its own module.
1541 (pupa_dl_unload_unneeded): Declared.
1542 (pupa_dl_unload_all): Likewise.
1543 (pupa_dl_ref): Likewise.
1544 (pupa_dl_unref): Likewise.
1545 (pupa_dl_iterate): Likewise.
1546 (pupa_dl_init): Renamed to ...
1547 (pupa_dl_set_prefix): ... this.
1548 (pupa_dl_get_prefix): Declared.
1550 * fs/fat.c [!PUPA_UTIL] (my_mod): New variable.
1551 (pupa_fat_dir) [!PUPA_UTIL]: Prevent the fat module from being
1553 (pupa_fat_open) [!PUPA_UTIL]: Refer itself if succeeded.
1554 (pupa_fat_close) [!PUPA_UTIL]: Unrefer itself.
1556 * configure.ac (tmp_CFLAGS): Added -Wshadow, -Wpointer-arith,
1557 -Wmissing-prototypes, -Wundef and -Wstrict-prototypes.
1559 2003-01-03 Yoshinori K. Okuji <okuji@enbug.org>
1561 * util/i386/pc/pupa-setup.c (setup): Define the internal
1562 function find_first_partition_start at the top level, because GCC
1563 3.0.x cannot compile internal functions in deeper scopes
1565 (find_root_device): Use lstat instead of stat.
1566 Don't follow symbolic links.
1567 Fix the path-constructing code.
1569 * util/i386/pc/biosdisk.c [__linux__] (BLKFLSBUF): New macro.
1570 (pupa_util_biosdisk_open) [__linux__]: Get the size of a device
1571 by a BLKGETSIZE ioctl first, because block devices don't fill
1572 the member st_mode of the structure stat on Linux.
1573 [__linux__] (linux_find_partition): Use a temporary buffer
1574 REAL_DEV for the working space. Copy it to DEV before returning.
1575 (open_device) [__linux__]: Call ioctl with BLKFLSBUF to make the
1576 buffer cache consistent.
1577 (get_os_disk) [__linux__]: Use the length 5 instead of 4 for
1578 strncmp. The previous value was merely wrong.
1579 (pupa_util_biosdisk_get_pupa_dev): Use stat instead of lstat.
1581 * fs/fat.c (pupa_fat_read_data): Shift 4 instead of 12 when the
1582 FAT size is 12. The previous value was merely wrong.
1584 * kern/main.c (pupa_main): Don't split the starting message from
1587 * kern/term.c (pupa_putchar): Put CR after LF instead of before
1588 LF, because BIOS goes crazy about character attributes in this
1591 2003-01-03 Yoshinori K. Okuji <okuji@enbug.org>
1593 * include/i386/pc/util/biosdisk.h: New file.
1594 * util/i386/pc/biosdisk.c: Likewise.
1595 * util/i386/pc/pupa-setup.c: Likewise.
1597 * Makefile.in (INCLUDE_DISTFILES): Added
1598 include/pupa/i386/pc/util/biosdisk.h.
1599 (UTIL_DISTFILES): Added biosdisk.c and pupa-setup.c under the
1600 directory util/i386/pc.
1601 (install-local): Added a rule for sbin_UTILITIES.
1602 (uninstall): Likewise.
1604 * util/i386/pc/pupa-mkimage.c (usage): Fix a typo in the doc.
1606 * util/misc.c (xrealloc): New function.
1607 (pupa_malloc): Likewise.
1608 (pupa_free): Likewise.
1609 (pupa_realloc): Likewise.
1610 (pupa_stop): Likewise.
1611 (pupa_putchar): Likewise.
1613 * kern/disk.c (pupa_disk_read): Prevent L from underflowing.
1615 * include/pupa/util/misc.h (xrealloc): Declared.
1617 * include/pupa/i386/pc/boot.h (PUPA_BOOT_MACHINE_BPB_START): New
1619 (PUPA_BOOT_MACHINE_BPBEND): Renamed to ...
1620 (PUPA_BOOT_MACHINE_BPB_END): ... this.
1622 * include/pupa/fs.h [PUPA_UTIL] (pupa_fat_init): Declared.
1623 [PUPA_UTIL] (pupa_fat_fini): Likewise.
1625 * fs/fat.c [PUPA_UTIL] (pupa_fat_init): Defined. Maybe a better
1626 way should be implemented.
1627 [PUPA_UTIL] (pupa_fat_fini): Likewise.
1629 * disk/i386/pc/biosdisk.c (pupa_biosdisk_call_hook): Increase
1630 the size of NAME for safety.
1631 (pupa_biosdisk_iterate): Search hard disks to 0x90 instead of
1634 * conf/i386-pc.rmk (sbin_UTILITIES): New variable.
1635 (pupa_setup_SOURCES): Likewise.
1637 * genmk.rb (Utility#rule): Add $(BUILD_CFLAGS) into the rules.
1639 2002-12-28 Yoshinori K. Okuji <okuji@enbug.org>
1641 * kern/i386/pc/startup.S (push_get_mmap_entry): Revert to a
1642 bunch of pushl's from pusha, because this destroys the return
1645 2002-12-28 Yoshinori K. Okuji <okuji@enbug.org>
1647 Use -mrtd and -mregparm=3 to reduce the generated code sizes.
1648 This means that any missing prototypes could be fatal. Also, you
1649 must take care when writing assembly code. See the comments at
1650 the beginning of startup.S, for more details.
1652 * kern/i386/pc/startup.S (pupa_halt): Modified for the new
1653 compilation mechanism.
1654 (pupa_chainloader_real_boot): Likewise.
1655 (pupa_biosdisk_rw_int13_extensions): Likewise.
1656 (pupa_biosdisk_rw_standard): Likewise.
1657 (pupa_biosdisk_check_int13_extensions): Likewise.
1658 (pupa_biosdisk_get_diskinfo_int13_extensions): Likewise.
1659 (pupa_biosdisk_get_diskinfo_standard): Likewise.
1660 (pupa_get_memsize): Likewise.
1661 (pupa_get_mmap_entry): Likewise.
1662 (pupa_console_putchar): Likewise.
1663 (pupa_console_setcursor): Likewise.
1664 (pupa_getrtsecs): Use pushl instead of push.
1666 * kern/i386/pc/init.c (pupa_machine_init): Use the scratch
1667 memory instead of the stack for a mmap entry, because some
1668 BIOSes may ignore the maximum size and overflow.
1670 * conf/i386-pc.rmk (COMMON_CFLAGS): Added -mrtd and -mregparm=3.
1672 * genmk.rb (PModule#rule): Compile automatically generated
1673 sources with module-specific CFLAGS as well as other sources.
1675 2002-12-27 Yoshinori K. Okuji <okuji@enbug.org>
1677 * configure.ac: Check ld.
1678 Replace CFLAGS and CPPFLAGS with BUILD_CFLAGS and BUILD_CPPFLAGS
1679 respectively, before checking endianness and sizes.
1681 * Makefile.in (LD): New variable.
1683 2002-12-27 Yoshinori K. Okuji <okuji@enbug.org>
1685 * Makefile.in (BUILD_CC): CC -> BUILD_CC.
1687 2002-12-27 Yoshinori K. Okuji <okuji@enbug.org>
1689 * Changelog: New file.