]> git.proxmox.com Git - grub2.git/blame - ChangeLog
2005-01-22 Hollis Blanchard <hollis@penguinppc.org>
[grub2.git] / ChangeLog
CommitLineData
8b8cbdb2 12005-01-22 Hollis Blanchard <hollis@penguinppc.org>
2
3 * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_open): Don't initialize
4 `devpath' to 0. Use `name' instead of `devpath' with `grub_strndup'.
5
e3741a27 62005-01-22 Marco Gerards <metgerards@student.han.nl>
7
8 * kern/misc.c (grub_strndup): Function rewritten.
9
776bd780 102005-01-22 Vincent Pelletier <subdino2004@yahoo.fr>
11
12 * normal/menu.c (TERM_WIDTH): Macro redefined.
13 (TERM_TOP_BORDER_Y): Likewise.
14 (draw_border): Replaced while-loop by a for-loop. Make the number
15 of lines consistent with the number of lines displayed in
16 print_entries. Added a margin below the rectangle.
17 (print_entry): Make the entry fit in the rectangle.
18 (print_entries): Display the scroll arrows next to the right
19 border.
20
78026bce 212005-01-21 Marco Gerards <metgerards@student.han.nl>
22
23 * fs/minix.c (grub_minix_find_file): Reserve more space for
24 `fpath' so the \0 can be stored. Use `grub_strcpy' instead of
25 `grub_strncpy' to copy `path' into it.
26
67bbaf0f 272005-01-21 Marco Gerards <metgerards@student.han.nl>
28
29 Add the loopback device, a device via which files can be accessed
30 as devices.
31
32 * conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/loopback.c'.
33 (pkgdata_MODULES): Add loopback.mod.
34 (loopback_mod_SOURCES): New variable.
35 (loopback_mod_CFLAGS): Likewise.
36 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add
37 `disk/loopback.c'.
38 (pkgdata_MODULES): Add loopback.mod.
39 (loopback_mod_SOURCES): New variable.
40 (loopback_mod_CFLAGS): Likewise.
41 * disk/loopback.c: new file.
42 * include/grub/normal.h (grub_loop_init): New prototype.
43 (grub_loop_fini): New prototype.
44 * util/grub-emu.c (main): Initialize and de-initialize loopback
45 support.
46 * include/grub/disk.h (grub_disk_dev_id): Add
47 `GRUB_DISK_DEVICE_LOOPBACK_ID'.
48
6f1c18bd 492005-01-20 Hollis Blanchard <hollis@penguinppc.org>
50
51 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_enter): New
52 function.
53 * conf/powerpc-ieee1275.rmk (pkgdata_MODULES): Add suspend.mod.
54 (suspend_mod_SOURCES): New variable.
55 (suspend_mod_CFLAGS): Likewise.
56 * include/grub/powerpc/ieee1275/ieee1275.h (grub_ieee1275_enter):
57 New prototype.
58 * commands/ieee1275/suspend.c: New file.
59
b38551da 602005-01-20 Timothy Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
61
62 * include/grub/dl.h (GRUB_MOD_INIT): Changed `__attribute__
63 ((unused))' to `__attribute__ ((used))'.
64 (GRUB_MOD_FINI): Likewise.
65 * kern/dl.c (grub_dl_load_file): Fix null pointer dereference.
66 * genmk.rb (PModule): Assign space to common symbols when linking
67 modules.
68
777aff39 692005-01-20 Marco Gerards <metgerards@student.han.nl>
70
71 * include/grub/mm.h (grub_mm_init_region): Change the type of the
72 `unsigned' arguments to `grub_size_t'.
73 (grub_malloc): Likewise.
74 (grub_realloc): Likewise.
75 (grub_memalign): Likewise.
76 * kern/i386/dl.c (grub_arch_dl_check_header): Likewise.
77 * kern/powerpc/dl.c (grub_arch_dl_check_header): Likewise.
78 * util/misc.c (grub_malloc): Likewise.
79 (grub_realloc): Likewise.
80 * kern/mm.c (get_header_from_pointer): Change the casts to
81 `unsigned' into a cast to `grub_size_t'.
82
83 * fs/fshelp.c (grub_fshelp_find_file): The `oldnode' should always
84 point to `currnode' when `currnode' is changed.
85
86 * util/grub-emu.c (main): Initialize `progname'. Reported by Nico
87 Schottelius <nico-linux@schottelius.org>.
88
d0ff18e1 892005-01-09 Hollis Blanchard <hollis@penguinppc.org>
90
91 * util/powerpc/ieee1275/grub-mkimage.c: Include <string.h>.
92 (note_path): Remove variable.
93 (GRUB_IEEE1275_NOTE_NAME): New macro.
94 (GRUB_IEEE1275_NOTE_TYPE): Likewise.
95 (grub_ieee1275_note_hdr): New structure.
96 (grub_ieee1275_note_desc): Likewise.
97 (grub_ieee1275_note): Likewise.
98 (load_note): Remove `dir' argument. All callers updated. Remove
99 `note_img' and `path'. Do not load a file from `note_path'.
100 Initialize a struct grub_ieee1275_note and write that to `out'.
101 Use GRUB_IEEE1275_MODULE_BASE instead of MODULE_BASE.
102
4ca7004c 1032005-01-05 Marco Gerards <metgerards@student.han.nl>
104
105 * util/misc.c (grub_util_read_image): Revert last change. It
106 called `grub_util_read_at', which seeks from the beginning of the
107 file.
108
0b412211 1092005-01-04 Hollis Blanchard <hollis@penguinppc.org>
110
111 * TODO: Add note about endianness in grub-mkimage.
112 * boot/powerpc/ieee1275/crt0.S (note): Remove unused .note
113 section.
114 * conf/powerpc-ieee1275.rmk (bin_UTILITIES): Add grub-mkimage.
115 (grub_mkimage_SOURCES): New target.
116 * include/grub/kernel.h (grub_start_addr): Remove variable.
117 (grub_end_addr): Likewise.
118 (grub_total_module_size): Likewise.
119 (grub_kernel_image_size): Likewise.
120 (GRUB_MODULE_MAGIC): New constant.
121 (grub_module_info): New structure.
122 (grub_arch_modules_addr): New prototype.
123 (grub_get_end_addr): Remove prototype.
124 * include/grub/i386/pc/kernel.h (grub_end_addr): New prototype.
125 * include/grub/powerpc/ieee1275/kernel.h: New file.
126 * include/grub/util/misc.h (grub_util_get_fp_size): New
127 prototype.
128 (grub_util_read_at): Likewise.
129 (grub_util_write_image_at): Likewise.
130 * kern/main.c (grub_get_end_addr): Remove function.
131 (grub_load_modules): Call grub_arch_modules_addr instead of using
132 grub_end_addr. Look for a grub_module_info struct in memory. Use
133 the grub_module_info fields instead of calling grub_get_end_addr
134 as loop conditions. Move grub_add_unused_region code here.
135 (grub_add_unused_region): Remove function.
136 * kern/i386/pc/init.c: Include grub/cache.h.
137 (grub_machine_init): Remove call to grub_get_end_addr. Remove
138 one call to add_mem_region.
139 (grub_arch_modules_addr): New function.
140 * kern/powerpc/ieee1275/init.c (grub_end_addr): Remove variable.
141 (grub_total_module_size): Likewise.
142 Include grub/machine/kernel.h.
143 (grub_arch_modules_addr): New function.
144 * util/grub-emu.c (grub_end_addr): Remove variable.
145 (grub_total_module_size): Likewise.
146 (grub_arch_modules_addr): New function.
147 * util/misc.c: Include unistd.h.
148 (grub_util_get_fp_size): New function.
149 (grub_util_read_at): Likewise.
150 (grub_util_write_image_at): Likewise.
151 (grub_util_read_image): Call grub_util_read_at.
152 (grub_util_write_image): Call grub_util_write_image_at.
153 * util/i386/pc/grub-mkimage.c (generate_image): Allocate
154 additional memory in kernel_img for a struct grub_module_info.
155 Fill in that grub_module_info.
156 * util/powerpc/ieee1275/grub-mkimage.c: New file.
157
458786f8 1582005-01-03 Hollis Blanchard <hollis@penguinppc.org>
159
160 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_milliseconds):
161 New function.
162 * include/grub/powerpc/ieee1275/ieee1275.h
163 (grub_ieee1275_milliseconds): New prototype.
164 * include/grub/powerpc/ieee1275/time.h (GRUB_TICKS_PER_SECOND):
165 Change to 1000.
166 * kern/powerpc/ieee1275/init.c (grub_get_rtc): Call
167 grub_ieee1275_milliseconds.
168
ac507d1b 1692005-01-03 Hollis Blanchard <hollis@penguinppc.org>
170
171 * boot/powerpc/ieee1275/cmain.c (grub_ieee1275_realmode): New
172 variable.
173 (find_options): New function.
174 (cmain): Call find_options.
175 * include/grub/powerpc/ieee1275/ieee1275.h
176 (grub_ieee1275_realmode): New extern variable.
177 * kern/powerpc/ieee1275/openfw.c (grub_claimmap): Only call
178 grub_map if grub_ieee1275_realmode is false.
179
6b8fd1c4 1802004-12-29 Marco Gerards <metgerards@student.han.nl>
181
182 * normal/cmdline.c (grub_cmdline_get): Redone logic so no empty
183 lines are inserted and make it work like readline. Reported by
184 Vincent Pelletier <subdino2004@yahoo.fr>.
185
8514a1e0 1862004-12-28 Marco Gerards <metgerards@student.han.nl>
187
188 * boot/powerpc/ieee1275/crt0.S (_start): Don't set up the stack.
189
190 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCE): Remove
191 `kern/powerpc/cache.S'.
192
924b6140 1932004-12-27 Marco Gerards <metgerards@student.han.nl>
194
195 * genmk.rb: Handle the `Program' class in the main loop. Written
196 by Johan Rydberg <jrydberg@gnu.org>.
197 (Program): New class.
198 (programs): New variable.
199 * boot/powerpc/ieee1275/cmain.c: Include <grub/machine/ieee1275.h>
200 instead of "grub/machine/ieee1275.h". Include <grub/kernel.h>
201 instead of "grub/kernel.h". Include <grub/machine/init.h>.
202 (help_arch): Function removed.
203 * conf/powerpc-ieee1275.rmk (grubof_HEADERS): Add
204 `powerpc/libgcc.h' and `loader.h'.
205 (pkgdata_PROGRAMS): New variable.
206 (sbin_UTILITIES): Variable removed.
207 (grub_emu_SOURCES): Added kern/powerpc/cache.S.
208 (grubof_SOURCES): Variable re-defined so it only includes the
209 core functionality.
210 (grubof_CFLAGS): Remove `-DGRUBOF'.
211 (pkgdata_MODULES, fshelp_mod_SOURCES, fshelp_mod_CFLAGS,
212 (fat_mod_SOURCES, fat_mod_CFLAGS, ext2_mod_SOURCES)
213 (ext2_mod_CFLAGS, ufs_mod_SOURCES, ufs_mod_CFLAGS)
214 (minix_mod_SOURCES, minix_mod_CFLAGS, hfs_mod_SOURCES)
215 (hfs_mod_CFLAGS, jfs_mod_SOURCES, jfs_mod_CFLAGS)
216 (iso9660_mod_SOURCES, iso9660_mod_CFLAGS, _linux_mod_SOURCES)
217 (_linux_mod_CFLAGS, linux_mod_SOURCES, linux_mod_CFLAGS)
218 (normal_mod_SOURCES, normal_mod_CFLAGS, normal_mod_ASFLAGS)
219 (hello_mod_SOURCES, hello_mod_CFLAGS, boot_mod_SOURCES)
220 (boot_mod_CFLAGS, terminal_mod_SOURCES, terminal_mod_CFLAGS)
221 (ls_mod_SOURCES, ls_mod_CFLAGS, cmp_mod_SOURCES, cmp_mod_CFLAGS)
222 (cat_mod_SOURCES, cat_mod_CFLAGS, font_mod_SOURCES)
223 (font_mod_CFLAGS, amiga_mod_SOURCES, amiga_mod_CFLAGS)
224 (apple_mod_SOURCES, apple_mod_CFLAGS, pc_mod_SOURCES)
225 (pc_mod_CFLAGS): New variables.
226 * disk/powerpc/ieee1275/ofdisk.c: Include <grub/machine/init.h>.
227 (grub_ofdisk_iterate): Add a prototype for `dev_iterate'.
228 * include/grub/dl.h (grub_arch_dl_sync_caches): New prototype.
229 * include/grub/loader.h (grub_os_area_addr, grub_os_area_size):
230 Moved from here...
231 * include/grub/i386/pc/init.h (grub_os_area_addr)
232 (rub_os_area_size): ... to here.
233 * include/grub/powerpc/ieee1275/ieee1275.h
234 (grub_ieee1275_entry_fn): Export symbol.
235 * include/grub/powerpc/ieee1275/init.h: New file.
236 * include/grub/powerpc/libgcc.h: Likewise.
237 * include/grub/cache.h: Likewise.
238 * kern/powerpc/cache.S: Likewise. Written by Hollis Blanchard
239 <hollis@penguinppc.org>.
240 * kern/dl.c: Include <grub/cache.h>.
241 (grub_dl_flush_cache): New function.
242 (grub_dl_load_core): Call `grub_dl_flush_cache' to flush the cache
243 for this module.
244 * kern/powerpc/ieee1275/init.c (grub_ofdisk_init)
245 (grub_console_init): Removed prototypes.
246 (grub_machine_init): Don't initialize the modules anymore.
247 * kern/powerpc/ieee1275/openfw.c (grub_map): Make the function
248 static.
249 * include/grub/powerpc/types.h (GRUB_HOST_WORDS_LITTLEENDIAN):
250 Macro undef removed.
251 (GRUB_HOST_WORDS_BIGENDIAN): New macro.
252 * kern/powerpc/dl.c (grub_arch_dl_relocate_symbols): Add
253 relocation `R_PPC_REL32'. Return an error when the relocation is
254 unknown.
255 * Makefile.in (DATA): Add `$(pkgdata_PROGRAMS)'.
256 * kern/i386/pc/init.c (grub_arch_sync_caches): New function.
257 * util/misc.c (grub_arch_sync_caches): Likewise.
258
e4b47e0c 2592004-12-19 Marco Gerards <metgerards@student.han.nl>
260
261 * conf/powerpc-ieee1275.rmk (MOSTLYCLEANFILES): Remove
262 `symlist.c', add `grubof_symlist.c'.
263 (symlist.c): Variable removed.
264 (grubof_HEADERS): Variable added.
265 (grubof_symlist.c): New target.
266 (kernel_syms.lst): Use `grubof_HEADERS' instead of
267 `kernel_img_HEADERS'.
268 (grubof_SOURCES): Add `kern/powerpc/dl.c' and `grubof_symlist.c'.
269 * kern/powerpc/dl.c: New file.
270 * kern/powerpc/ieee1275/init.c (grub_arch_dl_check_header):
271 Function removed.
272 (grub_arch_dl_relocate_symbols): Likewise.
273 (grub_register_exported_symbols): Likewise.
274
4ceb3636 2752004-12-13 Marco Gerards <metgerards@student.han.nl>
276
277 * fs/ext2.c (grub_ext2_open): Don't use data after freeing it.
278 (grub_ext2_dir): Likewise. Don't return in case of an error, jump
279 to fail instead. Reported by Vincent Pelletier
280 <subdino2004@yahoo.fr>.
281
282 * fs/fshelp.c (grub_fshelp_find_file): Don't free `oldnode' when
283 it is not allocated. Reported by Vincent Pelletier
284 <subdino2004@yahoo.fr>.
285
286 * normal/cmdline.c (grub_tab_complete): Add a blank line to the
287 output so the output looks better.
288
3f1578fe 2892004-12-04 Marco Gerards <metgerards@student.han.nl>
290
291 Modulize the partition map support and add support for the amiga
292 partition map.
293
294 * commands/ls.c: Include <grub/partition.h> instead of
295 <grub/machine/partition.h>.
296 * kern/disk.c: Likewise.
297 * kern/rescue.c: Likewise.
298 * loader/i386/pc/chainloader.c: Likewise.
299 * normal/cmdline.c: Likewise.
300 * kern/powerpc/ieee1275/init.c: Likewise.
301 (grub_machine_init): Call `grub_pc_partition_map_init',
302 `grub_amiga_partition_map_init' and
303 `grub_apple_partition_map_init'.
304 * conf/i386-pc.rmk (kernel_img_SOURCES): Remove
305 `disk/i386/pc/partition.c'. Add `kern/partition.c'.
306 (kernel_img_HEADERS): Remove `machine/partition.h'. Add
307 `partition.h' and `pc_partition.h'.
308 (grub_setup_SOURCES): Remove
309 `disk/i386/pc/partition.c'. Add `kern/partition.c',
310 `partmap/amiga.c', `partmap/apple.c' and `partmap/pc.c'.
311 (grub_emu_SOURCES): Likewise.
312 (pkgdata_MODULES): Add `amiga.mod', `apple.mod' and `pc.mod'.
313 (amiga_mod_SOURCES, amiga_mod_CFLAGS, apple_mod_SOURCES)
314 (apple_mod_CFLAGS, pc_mod_SOURCES, pc_mod_CFLAGS): New variables.
315 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Remove
316 `disk/powerpc/ieee1275/partition.c'. Add `kern/partition.c',
317 `partmap/amiga.c', `partmap/apple.c' and `partmap/pc.c'.
318 (grubof_SOURCES): Likewise.
319 * disk/i386/pc/partition.c: File removed.
320 * disk/powerpc/ieee1275/partition.c: Likewise.
321 * include/grub/powerpc/ieee1275/partition.h: Likewise.
322 * include/grub/i386/pc/partition.h: Likewise.
323 * kern/partition.c: New file.
324 * partmap/amiga.c: Likewise.
325 * partmap/apple.c: Likewise.
326 * partmap/pc.c: Likewise.
327 * include/grub/partition.h: Likewise..
328 * include/grub/pc_partition.h: Likewise.
329 * util/grub-emu.c: Include <grub/partition.h> instead of
330 <grub/machine/partition.h>.
331 (main): Call `grub_pc_partition_map_init',
332 `grub_amiga_partition_map_init' and
333 `grub_apple_partition_map_init' and deinitialize afterwards.
334 * util/i386/pc/biosdisk.c: Include `#include
335 <grub/partition.h>' and `include <grub/pc_partition.h>' instead of
336 `<grub/machine/partition.h>'.
337 * util/i386/pc/grub-setup.c: Likewise.
338 * util/i386/pc/biosdisk.c: Likewise.
339 (grub_util_biosdisk_get_grub_dev): Only access the PC specific
340 partition information in case of a PC partition.
341 * util/i386/pc/grub-setup.c: Include `#include
342 <grub/partition.h>' and `include <grub/pc_partition.h>' instead of
343 `<grub/machine/partition.h>'.
344 (setup): Only access the PC specific partition information in case
345 of a PC partition.
346
0ef4ced9 3472004-11-17 Hollis Blanchard <hollis@penguinppc.org>
348
349 * kern/powerpc/ieee1275/init.c (grub_setjmp): Remove function.
350 (grub_longjmp): Likewise.
351 * include/grub/powerpc/setjmp.h (grub_jmp_buf): Set array size to
352 20.
353 * normal/powerpc/setjmp.S: New file.
354 * conf/powerpc-ieee1275.rmk (grubof_SOURCES): Add
355 `normal/powerpc/setjmp.S'.
356 (grubof_CFLAGS): Add `-DGRUBOF'.
357 * include/grub/setjmp.h [GRUB_UTIL]: Changed condition to
358 [GRUB_UTIL && !GRUBOF].
359
19950e29 3602004-11-16 Marco Gerards <metgerards@student.han.nl>
361
362 * kern/powerpc/ieee1275/openfw.c (grub_devalias_iterate): Skip any
363 property named `name'. Correctly handle the error returned by
364 `grub_ieee1275_finddevice' if a device can not be opened.
365
a2fea427 3662004-11-02 Hollis Blanchard <hollis@penguinppc.org>
367
368 * term/powerpc/ieee1275/ofconsole.c (grub_ofconsole_readkey): Test
369 `actual' for negativity.
370 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Remove
371 kern/fshelp.c.
372
41ea0ea3 3732004-11-01 Marco Gerards <metgerards@student.han.nl>
374
375 * term/i386/pc/vga.c (VGA_HEIGHT): Changed to 350.
376 (PAGE_OFFSET): New macro.
377 (CRTC_ADDR_PORT): Likewise.
378 (CRTC_DATA_PORT): Likewise.
379 (START_ADDR_HIGH_REGISTER): Likewise.
380 (START_ADDR_LOW_REGISTER): Likewise.
381 (GRAPHICS_ADDR_PORT): Likewise.
382 (GRAPHICS_DATA_PORT): Likewise.
383 (READ_MAP_REGISTER): Likewise.
384 (INPUT_STATUS1_REGISTER): Likewise.
385 (INPUT_STATUS1_VERTR_BIT): Likewise.
386 (page): New variable.
387 (wait_vretrace): New function.
388 (set_read_map): Likewise.
389 (set_start_address): Likewise.
390 (grub_vga_init): Use mode 0x10 instead of mode 0x12. Switch to
391 the right page.
392 (check_vga_mem): Take the page into account.
393 (write_char): Likewise.
394 (write_cursor): Likewise.
395 (scroll_up): Likewise. Copy the page to the page that is not
396 shown and switch between both pages.
397 (grub_vga_putchar): Fix off by one error.
398 (grub_vga_cls): Wait for the vertical retrace. Take the page into
399 account.
400
ad0bd20b 4012004-11-01 Marco Gerards <metgerards@student.han.nl>
402
403 Add support for iso9660 (including rockridge).
404
405 * conf/i386-pc.rmk (grub_emu_SOURCES): Add fs/iso9660.c.
406 (iso9660_mod_SOURCES): New variable.
407 (iso9660_mod_CFLAGS): Likewise.
408 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs/iso9660.c.
409 * include/grub/fs.h (grub_iso9660_init): New prototype.
410 * util/grub-emu.c (main): Call `grub_iso9660_init'.
411 * fs/iso9660.c: New file.
412
413 * include/grub/misc.h (grub_strncat): New prototype.
414 * kern/misc.c (grub_strncat): New function.
415
416 * fs/hfs.c (grub_hfs_mount): Translate the error
417 `GRUB_ERR_OUT_OF_RANGE' to `GRUB_ERR_BAD_FS'.
418 * fs/jfs.c (grub_jfs_mount): Likewise.
419 * fs/ufs.c (grub_ufs_mount): Likewise.
420
a5477a59 4212004-10-28 Hollis Blanchard <hollis@penguinppc.org>
422
423 * boot/powerpc/ieee1275/cmain.c (cmain): Remove asm statements
424 which initialized BAT registers.
425 * boot/powerpc/ieee1275/ieee1275.c (IEEE1275_CALL_ENTRY_FN,
426 grub_ieee1275_common_hdr, INIT_IEEE1275_COMMON):
427 Move from here...
428 * include/grub/powerpc/ieee1275/ieee1275.h (IEEE1275_CALL_ENTRY_FN,
429 grub_ieee1275_common_hdr, INIT_IEEE1275_COMMON):
430 ... to here.
431 * kern/powerpc/ieee1275/openfw.c (grub_map): New function.
432 (grub_mapclaim): Likewise.
433 * loader/powerpc/ieee1275/linux.c (grub_load_linux): Use
434 grub_mapclaim instead of grub_ieee1275_claim. Assign linux_addr by
435 hand.
436
9304c1f8 4372004-10-19 Hollis Blanchard <hollis@penguinppc.org>
438
439 * conf/powerpc-ieee1275.rmk (COMMON_ASFLAGS): Remove -fno-builtin.
440 (COMMON_CFLAGS): Remove -fno-builtin and -D__ASSEMBLY__. Add
441 -ffreestanding and -msoft-float.
442
86f4ae25 4432004-10-15 Hollis Blanchard <hollis@penguinppc.org>
444
445 * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_open): Do not
446 append ":0" to devpath if the GRUB_IEEE1275_NO_PARTITION_0 flag is
447 set in grub_ieee1275_flags.
448
38912228 4492004-10-14 Hollis Blanchard <hollis@penguinppc.org>
450
451 * include/grub/powerpc/ieee1275/ieee1275.h (abort): Add function
452 prototype.
453 * kern/powerpc/ieee1275/init.c (grub_machine_init): Call
454 grub_console_init first.
455 Change the memory range used for grub_ieee1275_claim and
456 grub_mm_init_region.
457 Print an error message if the claim fails.
458 Include <grub/misc.h>.
459
d1923dc8 4602004-10-13 Hollis Blanchard <hollis@penguinppc.org>
461
462 * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_iterate):
463 Call grub_children_iterate for device nodes of type `scsi',
464 `ide', or `ata'.
465 (grub_ofdisk_open): Remove manual device alias resolution.
466 Fix memory leak when device cannot be opened.
467 * include/grub/powerpc/ieee1275/ieee1275.h
468 (grub_children_iterate): New prototype.
469 * kern/powerpc/ieee1275/openfw.c (grub_children_iterate):
470 New function.
471 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_get_property):
472 Return -1 if args.size was -1.
473
4512e4f3 4742004-10-11 Hollis Blanchard <hollis@penguinppc.org>
475
476 * boot/powerpc/ieee1275/cmain.c (grub_ieee1275_flags): New global.
477 (cmain): Accept 3 parameters. Test for 0xdeadbeef, indicating Old
478 World Macintosh. If Old Wold, set flag in grub_ieee1275_flags; claim
479 Open Firmware's memory for it; claim memory from _start to _end.
480 * boot/powerpc/ieee1275/crt0.S (__bss_start): New extern.
481 (_end): New extern.
482 (_start): Zero BSS from __bss_start to _end.
483 * include/grub/powerpc/ieee1275/ieee1275.h (grub_ieee1275_flags):
484 New extern.
485 (GRUB_IEEE1275_NO_PARTITION_0): New #define.
486
4d61feb0 4872004-10-11 Hollis Blanchard <hollis@penguinppc.org>
488
ad0bd20b 489 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_claim): Return
490 -1 if args.base was -1.
4d61feb0 491
026fa2f9 4922004-10-08 Hollis Blanchard <hollis@penguinppc.org>
493
494 * term/powerpc/ieee1275/ieee1275.c (grub_ofconsole_cls): Use an ANSI
495 escape sequence instead of a literal ^L. Also call
496 grub_ofconsole_gotoxy.
497
9f2220ef 4982004-10-03 Hollis Blanchard <hollis@penguinppc.org>
499
500 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_claim): change
501 void * arguments to grub_addr_t. All callers updated. Also make
502 the `result' argument optional.
503 (grub_ieee1275_release): change void * arguments to grub_addr_t.
504 All callers updated.
505
8a572cd7 5062004-09-22 Hollis Blanchard <hollis@penguinppc.org>
507
508 * commands/ls.c (grub_ls_list_files): Use the string following the
509 initial ')', if present, as the filesystem path.
510 * kern/rescue.c (grub_rescue_cmd_ls): Likewise.
511
512 * conf/powerpc-ieee1275.rmk (grubof_SOURCES): List crt0.S first.
513
18aa81f2 5142004-09-18 Yoshinori K. Okuji <okuji@enbug.org>
515
516 Make the source code of the menu interface more readable.
517
518 * normal/menu.c: Include grub/mm.h.
519 (TERM_WIDTH): New macro.
520 (TERM_HEIGHT): Likewise.
521 (TERM_INFO_HEIGHT): Likewise.
522 (TERM_MARGIN): Likewise.
523 (TERM_SCROLL_WIDTH): Likewise.
524 (TERM_TOP_BORDER_Y): Likewise.
525 (TERM_LEFT_BORDER_X): Likewise.
526 (TERM_BORDER_WIDTH): Likewise.
527 (TERM_MESSAGE_HEIGHT): Likewise.
528 (TERM_BORDER_HEIGHT): Likewise.
529 (TERM_NUM_ENTRIES): Likewise.
530 (TERM_FIRST_ENTRY_Y): Likewise.
531 (TERM_ENTRY_WIDTH): Likewise.
532 (TERM_CURSOR_X): Likewise.
533 (draw_border): Use macros instead of magic numbers.
534 (print_entry): Likewise.
535 (print_entries): Likewise.
536 (run_menu): Likewise. Also, handle the key 'e'.
537 (run_menu_entry): Ignore empty command lines.
538 (print_message): Added a new argument EDIT. If EDIT is true,
539 print a different message.
540 (init_page): Likewise.
541 (edit_menu_entry): New function. Not implemented yet.
542
b47efe30 5432004-09-17 Marco Gerards <metgerards@student.han.nl>
544
545 Add `linux.mod' and `multiboot.mod' so linux and multiboot kernels
546 can be loaded from normal mode.
547
548 * conf/i386-pc.rmk (pkgdata_MODULES): Add `linux.mod' and
549 `multiboot.mod'.
550 (linux_mod_SOURCES, linux_mod_CFLAGS, multiboot_mod_SOURCES)
551 (multiboot_mod_CFLAGS): New variables.
552 * loader/i386/pc/linux_normal.c: New file.
553 * loader/i386/pc/multiboot_normal.c: Likewise.
554
555 * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Don't use the
556 attribute `unused'.
557
558 * fs/ext2.c (grub_ext2_iterate_dir): Fix typos in inode type. Use
559 `fdiro' to read the mode information from instead of `diro'.
560
561 * fs/fshelp.c (grub_fshelp_find_file): Set type to foundtype after
562 looking up a symlink.
563
564 * include/grub/normal.h (GRUB_COMMAND_FLAG_NO_ARG_PARSE): New
565 macro.
566 * normal/command.c (grub_command_execute): Don't parse the
567 arguments when `GRUB_COMMAND_FLAG_NO_ARG_PARSE' is set in the
568 flags of the command.
569
570 * normal/menu.c (grub_menu_run): Fix typo.
571
da75ac71 5722004-09-14 Hollis Blanchard <hollis@penguinppc.org>
573
574 * kern/powerpc/ieee1275/init.c (abort): Trap into Open Firmware.
575
576 * term/powerpc/ieee1275/ofconsole.c (grub_ofconsole_gotoxy): Use
577 `y + 1' instead of `y - 1'.
578
579 * conf/powerpc-ieee1275.rmk (grubof_LDFLAGS): Add `-N' and `-S'.
580
062b24c2 5812004-09-14 Yoshinori K. Okuji <okuji@enbug.org>
582
583 From Hollis Blanchard <hollis@penguinppc.org>:
584 * kern/misc.c (memmove): New alias for grub_memmove.
585 (memcmp): New alias for grub_memcmp.
586 (memset): New alias for grub_memset.
587 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_get_property):
588 Change "int handle" to "grub_ieee1275_phandle_t handle".
589 * include/grub/powerpc/ieee1275/ieee1275.h
590 (grub_ieee1275_get_property): Likewise.
591
8ddad845 5922004-09-12 Tomas Ebenlendr <ebik@ucw.cz>
593
594 Added normal mode command `chainloader' as module chain.mod, which
595 depends on normal.mod and _chain.mod.
596
597 * conf/i386-pc.rmk (pkgdata_MODULES): Add `chain.mod'.
598 (chain_mod_SOURCES, chain_mod_CFLAGS): Variables added.
599 * include/grub/i386/pc/loader.h (grub_rescue_cmd_chainloader):
600 Deleted prototype.
601 * loader/i386/pc/chainloader.c (grub_rescue_cmd_chainloader): All
602 but arguments parsing moved to ...
603 (grub_chainloader_cmd): ... here. New function.
604 * include/grub/i386/pc/chainloader.h: New file.
605 * loader/i386/pc/chainloader_normal.c: Likewise.
606
2c1f4ce3 6072004-09-11 Marco Gerards <metgerards@student.han.nl>
608
609 * conf/i386-pc.rmk (kernel_img_SOURCES): Added kern/fshelp.c.
610 (grub_mkimage_LDFLAGS): Likewise.
611 (grub_emu_SOURCES): Likewise.
612 (kernel_img_HEADERS): Added fshelp.h.
613 * fs/ext2.c: Include <grub/fshelp.h>.
614 (FILETYPE_REG): New macro.
615 (FILETYPE_INO_REG): Likewise.
616 (grub_ext_sblock): Renamed to `grub_ext2_sblock'.
617 Changed all users.
618 (ext2_block_group): Renamed to `grub_ext2_block_group'. Changed
619 all users.
620 (grub_fshelp_node): New struct.
621 (grub_ext2_data): Added member `diropen'. Changed member `inode'
622 to a pointer.
623 (grub_ext2_get_file_block): Removed function.
624 (grub_ext2_read_block): New function.
625 (grub_ext2_read_file): Replaced parameter `data' by `node'.
626 This function was written.
627 (grub_ext2_mount): Read the root inode. Create a diropen struct.
628 (grub_ext2_find_file): Removed function.
629 (grub_ext2_read_symlink): New function.
630 (grub_ext2_iterate_dir): Likewise.
631 (grub_ext2_open): Rewritten.
632 (grub_ext2_dir): Rewritten.
633 * include/grub/fshelp.h: New file.
634 * fs/fshelp.c: Likewise.
635
3c52136a 6362004-09-10 Yoshinori K. Okuji <okuji@enbug.org>
637
638 * normal/menu.c: Include grub/loader.h and grub/machine/time.h.
639 (print_message): Add a missing newline.
640 (run_menu): Added timeout support.
641 (run_menu_entry): New local function.
642 (grub_menu_run): Added support for booting.
643
644 * kern/loader.c (grub_loader_is_loaded): New function.
645
646 * include/grub/powerpc/ieee1275/time.h: Include grub/symbol.h.
647 (grub_get_rtc): Exported.
648
649 * include/grub/i386/pc/time.h: Include grub/symbol.h.
650 (grub_get_rtc): Exported.
651
652 * include/grub/normal.h (struct grub_command_list): Remove
653 constant from the member `command'.
654
655 * include/grub/loader.h (grub_loader_is_loaded): Declared.
656
657 * include/grub/err.h (GRUB_ERR_INVALID_COMMAND): New constant.
658
659 * conf/i386-pc.rmk (kernel_img_HEADERS): Added machine/time.h.
660
aa033560 6612004-08-28 Marco Gerards <metgerards@student.han.nl>
662
663 Add support for the JFS filesystem.
664
665 * fs/jfs.c: New file.
666 * include/grub/fs.h (grub_jfs_init): New prototype.
667 (grub_jfs_fini): New prototype.
668 * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/jfs.c.
669 (grub_emu_SOURCES): Likewise.
670 (pkgdata_MODULES): Add jfs.mod.
671 (jfs_mod_SOURCES): New variable.
672 (jfs_mod_CFLAGS): Likewise.
673 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs.jfs.c.
674 (grubof_SOURCES): Likewise.
675 * util/grub-emu.c (main): Initialize and deinitialize JFS support.
676
677 * fs/fat.c (grub_fat_find_dir): Convert the filename little
678 endian to the host endian.
679 (grub_fat_utf16_to_utf8): Move function from there...
680 * kern/misc.c (grub_utf16_to_utf8): ...to here. Do not convert
681 the endianess of the source string anymore.
682 * include/grub/misc.h (grub_utf16_to_utf8): New prototype.
683
94bc45af 6842004-08-24 Marco Gerards <metgerards@student.han.nl>
685
686 * commands/boot.c (grub_boot_init) [GRUB_UTIL]: Make conditional.
687 (grub_boot_fini) [GRUB_UTIL]: Likewise.
688 (GRUB_MOD_INIT) [!GRUB_UTIL]: Likewise.
689 (GRUB_MOD_FINI) [!GRUB_UTIL]: Likewise.
690
691 * fs/hfs.c (grub_hfs_find_node): Add a prototype for `node_found'.
692 (grub_hfs_iterate_dir): Make the function static. Add prototypes
693 for `node_found' and `it_dir'.
694 (grub_hfs_dir): Add prototype for `dir_hook'.
695
696 * fs/minix.c (grub_minix_get_file_block): Add prototype for
697 `grub_get_indir'. Rename `indir' in two blocks to `indir16'
698 and `indir32' to silence a gcc warning.
699
700 * include/grub/fs.h (grub_hfs_init): New prototype.
701 (grub_hfs_fini): Likewise.
702
703
97543f08 7042004-08-21 Yoshinori K. Okuji <okuji@enbug.org>
705
706 Each disk device has its own id now. This is useful to make use
707 of multiple disk devices.
708
709 * include/grub/disk.h (grub_disk_dev_id): New enum.
710 (GRUB_DISK_DEVICE_BIOSDISK_ID): New constant.
711 (GRUB_DISK_DEVICE_OFDISK_ID): Likewise.
712
713 * disk/i386/pc/biosdisk.c (grub_biosdisk_dev): Specify
714 GRUB_DISK_DEVICE_BIOSDISK_ID as an id.
715
716 * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_dev): Specify
717 GRUB_DISK_DEVICE_OFDISK_ID as an id.
718
719 * util/i386/pc/biosdisk.c (grub_util_biosdisk_dev): Specify
720 GRUB_DISK_DEVICE_BIOSDISK_ID as an id.
721
722 * include/grub/disk.h (struct grub_disk_dev): Added a new member
723 "id" which is used by the cache manager.
724
725 * normal/main.c (grub_normal_init_page): Use "GNU GRUB" instead
726 of just "GRUB".
727
64372eb4 7282004-08-18 Marco Gerards <metgerards@student.han.nl>
729
730 * fs/hfs.c: New file.
731 * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/hfs.c.
732 (grub_emu_SOURCES): Likewise.
733 (pkgdata_MODULES): Add hfs.mod.
734 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs/hfs.c.
735 (grubof_SOURCES): Likewise.
736 * util/grub-emu.c (main): Initialize and deinitialize HFS support.
737
738 * include/grub/misc.h (grub_strncasecmp): Add prototype.
739 * kern/misc.c (grub_strncasecmp): Add function.
740
cc61b58f 7412004-08-14 Marco Gerards <metgerards@student.han.nl>
742
743 * include/grub/arg.h (GRUB_ARG_OPTION_OPTIONAL): Surround macro
744 with parentheses.
745
746 * fs/ext2.c (FILETYPE_UNKNOWN): New macro.
747 (grub_ext2_dir): In case the directory entry type is unknown, read
748 it from the inode.
749
0ef123f6 7502004-08-02 Peter Bruin <pjbruin@dds.nl>
751
752 * loader/powerpc/ieee1275/linux.c (grub_linux_init): Pass
753 grub_load_linux instead of grub_rescue_cmd_linux as second
754 argument of grub_rescue_register_command.
755
756 * Makefile.in (RMKFILES): Add conf/powerpc-ieee1275.rmk.
757
a447c5df 7582004-07-27 Marco Gerards <metgerards@student.han.nl>
759
760 * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_release): New
761 function.
762 * commands/boot.c: Remove the check for `GRUB_UTIL'.
763 * conf/powerpc-ieee1275.rmk (grubof_SOURCES): Add
764 `loader/powerpc/ieee1275/linux.c',
765 `loader/powerpc/ieee1275/linux_normal.c' and `commands/boot.c'.
766 * include/grub/powerpc/ieee1275/ieee1275.h
767 (grub_ieee1275_release): New prototype.
768 * include/grub/powerpc/ieee1275/loader.h: Rewritten.
769 * kern/powerpc/ieee1275/init.c (grub_machine_init): Initialize
770 normal, boot, linux and linux_normal.
771 * loader/powerpc/ieee1275/linux.c: New file.
772 * loader/powerpc/ieee1275/linux_normal.c: Likewise.
773
5a9e3546 7742004-07-12 Marco Gerards <metgerards@student.han.nl>
775
776 * normal/arg.c (grub_arg_parse): Correct error handling after
777 reallocating the argumentlist (check if `argl' is not null instead
778 of checking if `args' is not null).
779 * kern/mm.c (grub_realloc): Return the same pointer when using the
780 same region, instead of returning the header address.
781
e15199cb 7822004-07-11 Marco Gerards <metgerards@student.han.nl>
783
784 * disk/powerpc/ieee1275/partition.c (grub_partition_iterate): Skip
785 one block instead of two when looking for the initial partition.
786 (grub_partition_probe): Initialize the local variable `p' with 0.
787 Use base 10 for the grub_strtoul call.
788 * kern/misc.c (grub_strncpy): Fix off by one bug. Eliminated the
789 need for one local variable.
790 (grub_strtoul): Don't add the new value to `num', instead of that
791 just assign it.
792
020616c2 7932004-07-11 Marco Gerards <metgerards@student.han.nl>
794
795 * conf/i386-pc.rmk (pkgdata_IMAGE): Add pxeboot.img.
796 (pxeboot_img_SOURCES): New variable.
797 (pxeboot_img_ASFLAGS): Likewise.
798 (pxeboot_img_LDFLAGS): Likewise.
799 * boot/i386/pc/pxeboot.S: New file. Based on pxeloader.S from
800 GRUB Legacy and boot.S. Adopted for GRUB 2 by lode leroy
801 <lode_leroy@hotmail.com>.
802
6c51eb64 8032004-06-27 Tomas Ebenlendr <ebik@ucw.cz>
804
805 * kern/rescue.c (grub_enter_rescue_mode): Don't continue when
806 there was no input.
807
cfb12aff 8082004-06-27 Tomas Ebenlendr <ebik@ucw.cz>
809
810 * normal/cmdline.c (grub_set_history): Fix off by one bug. Fixed
811 the history buffer logic.
812
6eabba74 8132004-06-27 Tomas Ebenlendr <ebik@ucw.cz>
814
815 * fs/ext2.c (FILETYPE_INO_MASK, FILETYPE_INO_DIRECTORY)
816 (FILETYPE_INO_SYMLINK): New macros.
817 (grub_ext2_find_file): Check if the node is a directory using the
818 inode stat information instead of using the filetype in the
819 dirent. Exclude the first character of an absolute symlink.
820 (grub_ext2_dir): Mask out the filetype part of the mode member of
821 the inode.
822
66e19ef8 8232004-05-24 Marco Gerards <metgerards@student.han.nl>
824
825 Add support for UFS version 1 and 2. Add support for the minix
826 filesystem version 1 and 2, both the variants with 14 and 30 long
827 filenames.
828
829 * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/ufs.c and
830 fs/minix.c.
831 (grub_emu_SOURCES): Likewise.
832 (pkgdata_MODULES): Add ufs.mod and minix.mod.
833 (ufs_mod_SOURCES): New variable.
834 (ufs_mod_CFLAGS): Likewise.
835 (minix_mod_SOURCES): Likewise.
836 (minix_mod_CFLAGS): Likewise.
837 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs/ufs.c and
838 fs/minix.c.
839 (grubof_SOURCES): Likewise.
840 * fs/ufs.c: New file.
841 * fs/minix.c: New file.
842 * include/grub/fs.h (grub_ufs_init): New prototype.
843 (grub_ufs_fini): Likewise.
844 (grub_minix_init): Likewise.
845 (grub_minix_fini): Likewise.
846 * util/grub-emu.c (main): Initialize and deinitialize UFS and
847 minix fs.
848
cc2e748a 8492004-04-30 Jeroen Dekkers <jeroen@dekkers.cx>
850
851 * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add normal/arg.c,
852 commands/ls.c, commands/terminal.c, commands/boot.c,
853 commands/cmp.c and commands/cat.c.
854 (grubof_LDFLAGS): Add -nostdlib -static-libgcc -lgcc.
855
856 * kern/powerpc/ieee1275/init.c: Include "grub/env.h" instead of
857 "env.h"
858
4b13b216 8592004-04-04 Yoshinori K. Okuji <okuji@enbug.org>
860
861 All symbols prefixed with PUPA_ and pupa_ are renamed to GRUB_
862 and grub_, respectively. Because the conversion is trivial and
863 mechanical, I omit the details here. Please refer to the CVS
864 if you need more information.
865
6a142551 8662004-04-04 Yoshinori K. Okuji <okuji@enbug.org>
867
868 * include/pupa: Renamed to ...
869 * include/grub: ... this.
870 * util/i386/pc/pupa-mkimage.c: Renamed to ...
871 * util/i386/pc/grub-mkimage.c: ... this.
872 * util/i386/pc/pupa-setup.c: Renamed to ...
873 * util/i386/pc/grub-setup.c: ... this.
874 * util/pupa-emu.c: Renamed to ...
875 * util/grub-emu.c: ... this.
876
e56cdf21 8772004-03-29 Marco Gerards <metgerards@student.han.nl>
878
879 Add support for the newworld apple macintosh (PPC). This has been
880 tested on the powerbook 2000 only. It only adds support for
881 generic ieee1275 functions, console and disk support. This should
882 be easy to port to other architectures with support for Open
883 Firmware.
884
885 * configure.ac: Accept the powerpc as host_cpu. In the case of
886 the powerpc cpu set the host_vendor to ieee1275. Make sure the i386
887 specific tests are only executed while building for the i386.
888 Inverse test for crosscompile.
889 * genmk.rb (Utility): Allow assembler files.
890 * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno.
891 * conf/powerpc-ieee1275.rmk: New file.
892 * disk/powerpc/ieee1275/ofdisk.c: Likewise.
893 * disk/powerpc/ieee1275/partition.c: Likewise.
894 * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise.
895 * include/pupa/powerpc/ieee1275/console.h: Likewise.
896 * include/pupa/powerpc/ieee1275/partition.h: Likewise.
897 * include/pupa/powerpc/ieee1275/time.h: Likewise.
898 * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise.
899 * include/pupa/powerpc/ieee1275/multiboot.h: Likewise.
900 * include/pupa/powerpc/ieee1275/loader.h
901 * include/pupa/powerpc/setjmp.h: Likewise.
902 * include/pupa/powerpc/types.h: Likewise.
903 * kern/powerpc/ieee1275/init.c: Likewise.
904 * kern/powerpc/ieee1275/openfw.c: Likewise.
905 * term/powerpc/ieee1275/ofconsole.c: Likewise.
906
907 These files were written by Johan Rydberg
908 (jrydberg@night.trouble.net) and I only modified them slightly.
909
910 * boot/powerpc/ieee1275/cmain.c: New file.
911 * boot/powerpc/ieee1275/crt0.S: Likewise.
912 * boot/powerpc/ieee1275/ieee1275.c: Likewise.
913 * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
914
8c8cc205 9152004-03-14 Jeroen Dekkers <jeroen@dekkers.cx>
916
917 * Makefile.in: Update copyright.
918 * genmodsrc.sh: Likewise.
919 * gensymlist.sh: Likewise.
920 * term/i386/pc/vga.c: Indent correctly.
921
922 * util/i386/pc/pupa-mkimage.c (usage): Use PACKAGE_BUGREPORT as
923 bugreporting address.
924 * util/i386/pc/pupa-setup.c (usage): Likewise,
925 (main): Call pupa_ext2_init and pupa_ext2_fini.
926
927 * fs/fat.c (log2): Renamed to ...
928 (fat_log2): ... this.
929 All callers changed.
930 * kern/misc.c (memcpy): Alias to pupa_memmove.
931 * loader/i386/pc/multiboot.c (pupa_rescue_cmd_multiboot): Fix
932 lvalue cast.
933 * util/console.c (pupa_ncurses_fini): Return 0.
934
935 * util/i386/pc/biosdisk.c (pupa_util_biosdisk_open)[__linux__]:
936 Move fail label here.
937 [__GNU__]: Don't warn when using stat.
938 (open_device)[!__linux__]: Check if FD < 0 instead of !FD.
939 (pupa_util_biosdisk_get_pupa_dev)[__GNU__]: Change type of N to
940 long int. Use strtol instead of strtoul.
941
db1771cf 9422004-03-14 Marco Gerards <metgerards@student.han.nl>
943
944 * commands/boot.c: New file.
945 * commands/cat.c: Likewise.
946 * commands/cmp.c: Likewise.
947 * commands/ls.c: Likewise.
948 * commands/terminal.c: Likewise.
949 * normal/command.c: Include <pupa/env.h> and <pupa/dl.h>.
950 (pupa_register_command): Changed interface to match the new
951 argument parser.
952 (pupa_command_execute): Changed (almost rewritten) so it uses
953 pupa_split_command. Added support for setting variables using the
954 syntax `foo=bar'.
955 (rescue_command): Changed to work with the new argument parser.
956 (terminal_command): Moved from here to commands/terminal.c.
957 (set_command): New function.
958 (unset_command): New function.
959 (insmod_command): New function.
960 (rmmod_command): New function.
961 (lsmod_command): New function.
962 (pupa_command_init): Don't initialize the command terminal
963 anymore. Initialize the commands set, unset, insmod, rmmod and
964 lsmod.
965 * conf/i386-pc.rmk (kernel_img_SOURCES): Add kern/env.c.
966 (kernel_img_HEADERS): Add arg.h and env.h.
967 (pupa_mkimage_LDFLAGS): Add kern/env.c.
968 (pupa_emu_SOURCES): Add kern/env.c, commands/ls.c,
969 commands/terminal.c commands/boot.c commands/cmp.c commands/cat.c,
970 normal/arg.c.
971 (pkgdata_MODULES): Add ls.mod, boot.mod, cmp.mod, cat.mod and
972 terminal.mod.
973 (normal_mod_SOURCES): Add normal/arg.c and normal/arg.c.
974 (boot_mod_SOURCES): New variable.
975 (terminal_mod_SOURCES): Likewise.
976 (ls_mod_SOURCES): Likewise.
977 (cmp_mod_SOURCES): Likewise.
978 (cat_mod_SOURCES): Likewise.
979
980 * normal/arg.c: New file.
981 * kern/env.c: Likewise.
982 * include/pupa/arg.h: Likewise.
983 * include/pupa/env.h: Likewise.
984 * font/manager.c (font_command): Changed to match argument parsing
985 interface changes.
986 (PUPA_MOD_INIT): Likewise.
987 * hello/hello.c (pupa_cmd_hello): Likewise.
988 (PUPA_MOD_INIT): Likewise.
989 * include/pupa/disk.h: Include <pupa/device.h>.
990 (pupa_print_partinfo): New prototype.
991 * include/pupa/dl.h (pupa_dl_set_prefix): Prototype removed.
992 (pupa_dl_get_prefix): Likewise.
993 * include/pupa/misc.h: Include <pupa/err.h>.
994 (pupa_isgraph): New prototype.
995 (pupa_isdigit): Likewise.
996 (pupa_split_cmdline): Likewise.
997 * include/pupa/normal.h: Include <pupa/arg.h>.
998 (pupa_command): Changed the prototype of the member `func' to
999 match the argument parsing interface. Added member `options'.
1000 (pupa_register_command): Updated to match function.
1001 (pupa_arg_parse): New prototype.
1002 (pupa_hello_init) [PUPA_UTIL]: New prototype.
1003 (pupa_hello_fini) [PUPA_UTIL]: Likewise.
1004 (pupa_ls_init) [PUPA_UTIL]: Likewise.
1005 (pupa_ls_fini) [PUPA_UTIL]: Likewise.
1006 (pupa_cat_init) [PUPA_UTIL]: Likewise.
1007 (pupa_cat_fini) [PUPA_UTIL]: Likewise.
1008 (pupa_boot_init) [PUPA_UTIL]: Likewise.
1009 (pupa_boot_fini) [PUPA_UTIL]: Likewise.
1010 (pupa_cmp_init) [PUPA_UTIL]: Likewise.
1011 (pupa_cmp_fini) [PUPA_UTIL]: Likewise.
1012 (pupa_terminal_init) [PUPA_UTIL]: Likewise.
1013 (pupa_terminal_fini) [PUPA_UTIL]: Likewise.
1014 * kern/disk.c: Include <pupa/file.h>.
1015 (pupa_print_partinfo): New function.
1016 * kern/dl.c: Include <pupa/env.h>.
1017 (pupa_dl_dir): Variable removed.
1018 (pupa_dl_load): Use the environment variable `prefix' instead of
1019 the variable pupa_dl_dir.
1020 (pupa_dl_set_prefix): Function removed.
1021 (pupa_dl_get_prefix): Likewise.
1022 * kern/i386/pc/init.c: Include <pupa/env.h>.
1023 (pupa_machine_init): Use the environment variable `prefix' instead of
1024 using pupa_dl_set_prefix to set the prefix.
1025 * kern/main.c: Include <pupa/env.h>.
1026 (pupa_set_root_dev): Use the environment variable `prefix' instead of
1027 using pupa_dl_get_prefix to get the prefix.
1028 * kern/misc.c: Include <pupa/env.h>.
1029 (pupa_isdigit): New function.
1030 (pupa_isgraph): Likewise.
1031 (pupa_ftoa): Likewise.
1032 (pupa_vsprintf): Added support for printing values of the type
1033 `double'. Make it possible to format variable output when using
1034 formatting like `%1.2%f'.
1035 (pupa_split_cmdline): New function.
1036 * kern/rescue.c: Include <pupa/env.h>.
1037 (next_word): Removed function.
1038 (pupa_rescue_cmd_prefix): Likewise.
1039 (pupa_rescue_cmd_set): New function.
1040 (pupa_rescue_cmd_unset): New function.
1041 (pupa_enter_rescue_mode): Use the `pupa_split_cmdline' function to
1042 split the command line instead of splitting it here. Added
1043 support for setting variables using the syntax `foo=bar'. Don't
1044 initialize the prefix command anymore. Initialized the set and
1045 unset commands.
1046 * normal/cmdline.c: Include <pupa/env.h>.
1047 (pupa_tab_complete): Added prototypes for print_simple_completion,
1048 print_partition_completion, add_completion, iterate_commands,
1049 iterate_dev, iterate_part and iterate_dir. Moved code to print
1050 partition information from here to kern/disk.c.
1051 (pupa_cmdline_run): Don't check if the funtion exists anymore.
1052 * normal/main.c: Include <pupa/env.h>.
1053 (pupa_rescue_cmd_normal): Use the environment variable `prefix'
1054 instead of using pupa_dl_get_prefix to get the prefix.
1055 * term/i386/pc/vga.c: Include <pupa/arg.h>.
1056 (check_vga_mem): Cast pointers to `void *' to silence a gcc
1057 warning.
1058 (pupa_vga_putchar) [! DEBUG_VGA]: Removed for this case.
1059 (pupa_vga_setcolor): Declare unused variables with `__attribute__
1060 ((unused))' to silence a gcc warning.
1061 (pupa_vga_setcolor): Likewise.
1062 (debug_command): Changed to match argument parsing
1063 interface changes.
1064 * util/pupa-emu.c: Include <pupa/env.h>.
1065 (options): Added 0's for unused fields to silence a gcc warning.
1066 (argp): Likewise.
1067 (main): Use the environment variable `prefix' instead of using
1068 pupa_dl_set_prefix to set the prefix. Initialize the commands ls,
1069 boot, cmp, cat and terminal. Finish the commands boot, cmp, cat
1070 and terminal.
1071
1072 * util/i386/pc/getroot.c: Include <pupa/i386/pc/util/biosdisk.h>.
1073 * util/misc.c: Include <malloc.h>.
1074 (pupa_malloc): Rewritten so errors are correctly reported.
1075 (pupa_realloc): Likewise.
1076 (pupa_memalign): Likewise.
1077 (pupa_mm_init_region): Declare unused variables with
1078 `__attribute__ ((unused))' to silence a gcc warning.
1079 * normal/i386/setjmp.S: Remove tab at the end of the file to
1080 silence a gcc warning.
1081 * loader/i386/pc/linux.c (pupa_rescue_cmd_initrd): Declare unused
1082 variables with `__attribute__ ((unused))' to silence a gcc
1083 warning.
1084 * loader/i386/pc/multiboot.c (pupa_multiboot_unload): Make the
1085 local variable i unsigned to silence a gcc warning.
1086
1087 * kern/term.c: Include <pupa/misc.h>.
1088 (pupa_more_lines): New variable.
1089 (pupa_more): Likewise.
1090 (pupa_putcode): When the pager is active pause at the end of every
1091 screen.
1092 (pupa_set_more): New function.
1093 * include/pupa/term.h (pupa_set_more): New prototype.
1094
1095
3b1139cb 10962004-03-07 Yoshinori K. Okuji <okuji@enbug.org>
1097
1098 Now this project is GRUB 2 rather than PUPA. The location of
1099 the CVS repository was moved to GRUB's.
1100
1101 * configure.ac: Use bug-grub as the reporting address.
1102 Use GRUB instead of PUPA.
1103 Change the version number to 1.90.
1104
8367695c 11052004-02-24 Yoshinori K. Okuji <okuji@enbug.org>
1106
1107 * genkernsyms.sh: Updated copyright information.
1108 * genmk.rb: Likewise.
1109 * genmodsrc.sh: Likewise.
1110 * gensymlist.sh: Likewise.
1111 * boot/i386/pc/boot.S: Likewise.
1112 * boot/i386/pc/diskboot.S: Likewise.
1113 * disk/i386/pc/biosdisk.c: Likewise.
1114 * disk/i386/pc/partition.c: Likewise.
1115 * font/manager.c: Likewise.
1116 * fs/ext2.c: Likewise.
1117 * fs/fat.c: Likewise.
1118 * include/pupa/boot.h: Likewise.
1119 * include/pupa/device.h: Likewise.
1120 * include/pupa/disk.h: Likewise.
1121 * include/pupa/dl.h: Likewise.
1122 * include/pupa/elf.h: Likewise.
1123 * include/pupa/err.h: Likewise.
1124 * include/pupa/file.h: Likewise.
1125 * include/pupa/font.h: Likewise.
1126 * include/pupa/fs.h: Likewise.
1127 * include/pupa/kernel.h: Likewise.
1128 * include/pupa/loader.h: Likewise.
1129 * include/pupa/misc.h: Likewise.
1130 * include/pupa/mm.h: Likewise.
1131 * include/pupa/net.h: Likewise.
1132 * include/pupa/normal.h: Likewise.
1133 * include/pupa/rescue.h: Likewise.
1134 * include/pupa/setjmp.h: Likewise.
1135 * include/pupa/symbol.h: Likewise.
1136 * include/pupa/term.h: Likewise.
1137 * include/pupa/types.h: Likewise.
1138 * include/pupa/i386/setjmp.h: Likewise.
1139 * include/pupa/i386/types.h: Likewise.
1140 * include/pupa/i386/pc/biosdisk.h: Likewise.
1141 * include/pupa/i386/pc/boot.h: Likewise.
1142 * include/pupa/i386/pc/console.h: Likewise.
1143 * include/pupa/i386/pc/init.h: Likewise.
1144 * include/pupa/i386/pc/kernel.h: Likewise.
1145 * include/pupa/i386/pc/linux.h: Likewise.
1146 * include/pupa/i386/pc/loader.h: Likewise.
1147 * include/pupa/i386/pc/memory.h: Likewise.
1148 * include/pupa/i386/pc/multiboot.h: Likewise.
1149 * include/pupa/i386/pc/partition.h: Likewise.
1150 * include/pupa/i386/pc/time.h: Likewise.
1151 * include/pupa/i386/pc/vga.h: Likewise.
1152 * include/pupa/i386/pc/util/biosdisk.h: Likewise.
1153 * include/pupa/util/getroot.h: Likewise.
1154 * include/pupa/util/misc.h: Likewise.
1155 * include/pupa/util/resolve.h: Likewise.
1156 * kern/device.c: Likewise.
1157 * kern/disk.c: Likewise.
1158 * kern/dl.c: Likewise.
1159 * kern/err.c: Likewise.
1160 * kern/file.c: Likewise.
1161 * kern/fs.c: Likewise.
1162 * kern/loader.c: Likewise.
1163 * kern/main.c: Likewise.
1164 * kern/misc.c: Likewise.
1165 * kern/mm.c: Likewise.
1166 * kern/rescue.c: Likewise.
1167 * kern/term.c: Likewise.
1168 * kern/i386/dl.c: Likewise.
1169 * kern/i386/pc/init.c: Likewise.
1170 * kern/i386/pc/lzo1x.S: Likewise.
1171 * kern/i386/pc/startup.S: Likewise.
1172 * loader/i386/pc/chainloader.c: Likewise.
1173 * loader/i386/pc/linux.c: Likewise.
1174 * loader/i386/pc/multiboot.c: Likewise.
1175 * normal/cmdline.c: Likewise.
1176 * normal/command.c: Likewise.
1177 * normal/main.c: Likewise.
1178 * normal/menu.c: Likewise.
1179 * normal/i386/setjmp.S: Likewise.
1180 * term/i386/pc/console.c: Likewise.
1181 * term/i386/pc/vga.c: Likewise.
1182 * util/console.c: Likewise.
1183 * util/genmoddep.c: Likewise.
1184 * util/misc.c: Likewise.
1185 * util/pupa-emu.c: Likewise.
1186 * util/resolve.c: Likewise.
1187 * util/unifont2pff.rb: Likewise.
1188 * util/i386/pc/biosdisk.c: Likewise.
1189 * util/i386/pc/getroot.c: Likewise.
1190 * util/i386/pc/pupa-mkimage.c: Likewise.
1191 * util/i386/pc/pupa-setup.c: Likewise.
1192
e6eced71 11932004-02-15 Jeroen Dekkers <jeroen@dekkers.cx>
1194
1195 * fs/ext2.c (pupa_ext2_read_file): Correct the value of BLOCKEND
1196 when it is EXT2_BLOCK_SIZE (data). New argument READ_HOOK, all
1197 callers changed. Set DATA->DISK->READ_HOOK to READ_HOOK before
1198 reading and reset it after reading.
1199 (pupa_ext2_close): Return PUPA_ERR_NONE.
1200
1201 * include/pupa/i386/pc/linux.h (PUPA_LINUX_INITRD_MAX_ADDRESS):
1202 Correct value.
1203 (struct linux_kernel_header): Add kernel_version and
1204 initrd_addr_max.
1205 * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Check whether
1206 pupa_file_read succeeds.
1207 (pupa_rescue_cmd_initrd): Implement.
1208
5aded270 12092003-12-03 Marco Gerards <metgerards@student.han.nl>
1210
1211 * fs/ext2.c (pupa_ext2_label): New function.
1212 (pupa_ext2_fs): Added label.
1213 * fs/fat.c (pupa_fat_label): New function.
1214 (pupa_fat_fs): Added label.
1215 * include/pupa/fs.h (struct pupa_fs): Added prototype label.
1216
1217 * kern/misc.c (pupa_strndup): New function.
1218 * include/pupa/misc.h (pupa_strndup): New prototype.
1219
1220 * include/pupa/normal.h: Include <pupa/err.h>.
1221 (pupa_set_history): New prototype.
1222 (pupa_iterate_commands): New prototype.
1223 * normal/cmdline.c: Include <pupa/machine/partition.h>,
1224 <pupa/disk.h>, <pupa/file.h>.
1225 (hist_size): New variable.
1226 (hist_lines): Likewise.
1227 (hist_end): Likewise.
1228 (hist_used): Likewise.
1229 (pupa_set_history): New function.
1230 (pupa_history_get): Likewise.
1231 (pupa_history_add): Likewise.
1232 (pupa_history_replace): Likewise.
1233 (pupa_tab_complete): Likewise.
1234 (pupa_cmdline_run): Added tab completion and history buffer. Tab
1235 completion shows partitionnames while completing partitions, this
1236 feature was suggested by Jeff Bailey.
1237 * normal/command.c (pupa_iterate_commands): New function.
1238 * normal/main.c (PUPA_DEFAULT_HISTORY_SIZE): New macro.
1239 (pupa_normal_init): Initialize history buffer.
1240 (PUPA_MOD_INIT): Likewise.
1241 (pupa_normal_fini): Free the history buffer.
1242 (PUPA_MOD_FINI): Likewise.
1243
1244 * util/console.c (pupa_ncurses_getkey): Accept 127 as backspace
1245 key.
1246
1247 * aclocal.m4 (pupa_I386_CHECK_REGPARM_BUG): New DEFUN.
1248 * configure.ac [i386]: Check for regparam bug.
1249 (NESTED_FUNC_ATTR) [! i386]: Defined.
1250
1f7315a3 12512003-11-17 Marco Gerards <metgerards@student.han.nl>
1252
1253 * conf/i386-pc.rmk (sbin_UTILITIES): Added pupa-emu.
1254 (pupa_setup_SOURCES): Added util/i386/pc/getroot.c.
1255 (pupa_emu_SOURCES): New variable.
1256 (pupa_emu_LDFLAGS): Likewise.
1257 * include/pupa/fs.h (pupa_ext2_init) [PUPA_UTIL]: New prototype.
1258 (pupa_ext2_fini) [PUPA_UTIL]: Likewise.
1259 * include/pupa/normal.h (pupa_normal_init) [PUPA_UTIL]: Likewise.
1260 (pupa_normal_fini) [PUPA_UTIL]: Likewise.
1261 * include/pupa/setjmp.h [PUPA_UTIL]: Include <setjmp.h>.
1262 (pupa_jmp_buf): New typedef.
1263 (pupa_setjmp) [PUPA_UTIL]: New macro.
1264 (pupa_longjmp) [PUPA_UTIL]: Likewise.
1265 * include/pupa/term.h (struct pupa_term): New member `refresh'.
1266 (pupa_refresh): New prototype.
1267 * include/pupa/util/getroot.h: New file.
1268 * kern/misc.c (pupa_vsprintf): Refresh the screen after updating
1269 it.
1270 * kern/rescue.c (pupa_rescue_get_command_line): Likewise.
1271 (pupa_rescue_cmd_cat): Likewise.
1272 (pupa_rescue_cmd_ls): Likewise.
1273 (pupa_rescue_cmd_testload): Likewise.
1274 (pupa_rescue_cmd_lsmod): Likewise.
1275 * normal/cmdline.c (pupa_cmdline_get): Likewise.
1276 * normal/menu.c (run_menu): Likewise.
1277 * kern/term.c (pupa_cls): Likewise.
1278 (pupa_refresh): New function.
1279 * normal/normal.c (pupa_normal_init) [PUPA_UTIL]: New function.
1280 (pupa_normal_fini) [PUPA_UTIL]: Likewise.
1281 * util/console.c: New file.
1282
1283 * util/i386/pc/getroot.c: New file.
1284 * util/i386/pc/pupa-setup.c: Include <pupa/util/getroot.h>.
1285 (pupa_putchar): New function.
1286 (pupa_refresh): Likewise.
1287 (xgetcwd): Function moved to ...
1288 (strip_extra_slashes): Likewise.
1289 (get_prefix): Likewise.
1290 * util/i386/pc/getroot.c: ... here.
1291 (find_root_device): Function moved and renamed to...
1292 * util/i386/pc/getroot.c (pupa_find_root_device): ... here.
1293 Changed all callers.
1294 * util/i386/pc/pupa-setup.c (guess_root_device): Function moved
1295 and renamed to...
1296 * util/i386/pc/getroot.c (pupa_guess_root_device): ... here.
1297 Changed all callers.
1298 * util/misc.c (pupa_memalign): New function.
1299 (pupa_mm_init_region): Likewise.
1300 (pupa_register_exported_symbols): Likewise.
1301 (pupa_putchar): Function removed.
1302 * util/pupa-emu.c: New file.
1303
9a5c1ade 13042003-11-16 Jeroen Dekkers <jeroen@dekkers.cx>
1305
1306 * conf/i386-pc.rmk (pkgdata_MODULES): Add _multiboot.mod.
1307 (_multiboot_mod_SOURCES): New variable.
1308 (_multiboot_mod_CFLAGS): Likewise.
1309 * loader/i386/pc/multiboot.c: New file.
1310 * include/pupa/i386/pc/multiboot.h: Likewise.
1311 * kern/i386/pc/startup.S: Include pupa/machine/multiboot.h.
1312 (pupa_multiboot_real_boot): New function.
1313 * include/pupa/i386/pc/loader.h: Include pupa/machine/multiboot.h.
1314 (pupa_multiboot_real_boot): New prototype.
1315 (pupa_rescue_cmd_multiboot): Likewise
1316 (pupa_rescue_cmd_module): Likewise.
1317
1318 * kern/loader.c (pupa_loader_set): Continue when
1319 pupa_loader_unload_func() fails.
1320 (pupa_loader_unset): New function.
1321 * include/pupa/loader.h (pupa_loader_unset): New prototype.
1322
1323 * kern/misc.c (pupa_stpcpy): New function.
1324 * include/pupa/misc.h (pupa_stpcpy): New prototype.
1325
8e72a9c0 13262003-11-12 Marco Gerards <metgerards@student.han.nl>
1327
1328 * disk/i386/pc/biosdisk.c (pupa_biosdisk_open): Correctly check
1329 for available extensions.
1330
1331 * include/pupa/i386/pc/time.h: New file.
1332 * kern/disk.c: Include <pupa/machine/time.h>.
1333 (PUPA_CACHE_TIMEOUT): New macro.
1334 (pupa_last_time): New variable.
1335 (pupa_disk_open): Flush the cache when there was a timeout.
1336 (pupa_disk_close): Reset the timer.
1337 * kern/i386/pc/startup.S (pupa_get_rtc): Renamed from
1338 pupa_currticks.
1339 * util/misc.c: Include <sys/times.h>
1340 (pupa_get_rtc): New function.
1341
c4adbd32 13422003-11-09 Jeroen Dekkers <jeroen@dekkers.cx>
1343
1344 * fs/ext2.c (struct pupa_ext2_inode): Declare struct datablocks
1345 as blocks.
1346 (pupa_ext2_get_file_block): Use blocks member.
1347
1348 * fs/ext2.c (pupa_ext2_read_file): Only set skipfirst for the
1349 first block. Return -1 instead of pupa_errno on error.
1350
bfd30f06 13512003-10-27 Marco Gerards <metgerards@student.han.nl>
1352
1353 * README: In the pupa-mkimage example use _chain instead of chain
1354 and ext2 instead of fat.
1355 * TODO: Replace ext2fs with jfs as an example. Add an item for
1356 adding journal playback for ext2fs.
1357 * conf/i386-pc.rmk (pupa_setup_SOURCES): Added fs/ext2.c.
1358 (pkgdata_MODULES): Added ext2.mod.
1359 (ext2_mod_SOURCES): New variable.
1360 (ext2_mod_CFLAGS): Likewise.
1361 * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_SYMLINK_LOOP.
1362 * include/pupa/misc.h (pupa_strncpy): New prototype.
1363 (pupa_strcat): Likewise.
1364 (pupa_strncmp): Likewise.
1365 * kern/misc.c (pupa_strcat): Enable function.
1366 (pupa_strncpy): New function.
1367 (pupa_strncmp): Likewise.
1368 * fs/ext2.c: New file.
1369
1370 * kern/disk.c (pupa_disk_read): Set pupa_errno to PUPA_ERR_NONE
1371 when the read failed before retrying.
1372 * util/i386/pc/biosdisk.c (_LARGEFILE_SOURCE): Removed.
1373 (_FILE_OFFSET_BITS): Likewise.
1374 * configure.ac: Added AC_SYS_LARGEFILE.
1375
98d15063 13762003-09-25 Yoshinori K. Okuji <okuji@enbug.org>
1377
1378 * genmk.rb (PModule#rule): Make sure to get only symbol names
1379 from the output of nm.
1380 Reported by Robert Millan <zeratul2@wanadoo.es>.
1381
18d9c7cd 13822003-09-25 Yoshinori K. Okuji <okuji@enbug.org>
1383
1384 I forgot to check in these changes for a long time. This adds
1385 incomplete support for VGA console, and this is still very
1386 buggy. Also, a lot of consideration is required for I18N,
1387 UNICODE, and VGA font issues. Therefore, assume that this is
1388 such that "better than nothing".
1389
1390 * font/manager.c: New file.
1391 * include/pupa/font.h: Likewise.
1392 * include/pupa/i386/pc/vga.h: Likewise.
1393 * term/i386/pc/vga.c: Likewise.
1394 * util/unifont2pff.rb: Likewise.
1395
1396 * conf/i386-pc.rmk (kernel_img_HEADERS): Added machine/vga.h.
1397 (pkgdata_MODULES): Added vga.mod and font.mod.
1398 (vga_mod_SOURCES): New variables.
1399 (vga_mod_CFLAGS): Likewise.
1400 (font_mod_SOURCES): Likewise.
1401 (font_mod_CFLAGS): Likewise.
1402
1403 * include/pupa/err.h (PUPA_ERR_BAD_FONT): New constant.
1404
1405 * include/pupa/term.h: Include pupa/err.h.
1406 (struct pupa_term): Added init and fini.
1407 Changed the argument of putchar to pupa_uint32_t.
1408
1409 * include/pupa/i386/pc/console.h: Include pupa/symbol.h.
1410 (pupa_console_real_putchar): New prototype.
1411 (pupa_console_putchar): Removed.
1412 (pupa_console_checkkey): Exported.
1413 (pupa_console_getkey): Likewise.
1414
1415 * kern/misc.c (pupa_vsprintf): Add support for UNICODE
1416 characters.
1417
1418 * kern/term.c (pupa_term_set_current): Rewritten.
1419 (pupa_putchar): Likewise.
1420 (pupa_putcode): New function.
1421
1422 * kern/i386/pc/startup.S (pupa_console_putchar): Renamed to ...
1423 (pupa_console_real_putchar): ... this.
1424 (pupa_vga_set_mode): New function.
1425 (pupa_vga_get_font): Likewise.
1426
1427 * normal/command.c: Include pupa/term.h.
1428 (terminal_command): New function.
1429 (pupa_command_init): Register the command "terminal".
1430
1431 * normal/menu.c (DISP_LEFT): Changed to a UNICODE value.
1432 (DISP_UP): Likewise.
1433 (DISP_RIGHT): Likewise.
1434 (DISP_DOWN): Likewise.
1435 (DISP_HLINE): Likewise.
1436 (DISP_VLINE): Likewise.
1437 (DISP_UL): Likewise.
1438 (DISP_UR): Likewise.
1439 (DISP_LL): Likewise.
1440 (DISP_LR): Likewise.
1441
1442 * term/i386/pc/console.c (pupa_console_putchar): New function.
1443
977329f5 14442003-02-08 NIIBE Yutaka <gniibe@m17n.org>
1445
1446 * util/resolve.c (pupa_util_resolve_dependencies): BUG
1447 FIX. Reverse the path_list.
1448
1449 * include/pupa/normal.h: Export pupa_register_command and
1450 pupa_unregister_command.
1451
1452 * hello/hello.c (pupa_cmd_hello): New module.
1453 * conf/i386-pc.rmk: Added hello.mod.
1454
1f5ab428 14552003-01-31 Yoshinori K. Okuji <okuji@enbug.org>
1456
1457 * kern/i386/pc/lzo1x.S: New file.
1458
1459 * util/i386/pc/pupa-mkimage.c: Include lzo1x.h.
1460 (compress_kernel): New variable.
1461 (generate_image): Heavily modified to support compressing a
1462 large part of the core image.
1463
1464 * util/misc.c (pupa_util_read_image): Fix a file descriptor
1465 leak.
1466 (pupa_util_load_image): New function.
1467
1468 * kern/i386/pc/startup.S: Include pupa/machine/kernel.h.
1469 (pupa_compressed_size): New variable.
1470 (codestart): Enable Gate A20 here.
1471 Decompress the compressed part of the core image.
1472 Rearrange the code to put functions and variables which are
1473 required for initialization in the non-compressed part.
1474 Include lzo1x.S.
1475
1476 * kern/i386/pc/init.c (pupa_machine_init): Don't enable Gate A20
1477 here.
1478
1479 * include/pupa/util/misc.h (pupa_util_write_image): Declared.
1480
1481 * include/pupa/i386/pc/kernel.h
1482 (PUPA_KERNEL_MACHINE_COMPRESSED_SIZE): New macro.
1483 (PUPA_KERNEL_MACHINE_INSTALL_DOS_PART): Increased by 4.
1484 (PUPA_KERNEL_MACHINE_INSTALL_BSD_PART): Likewise.
1485 (PUPA_KERNEL_MACHINE_PREFIX): Likewise.
1486 (PUPA_KERNEL_MACHINE_RAW_SIZE): New macro.
1487
1488 * conf/i386-pc.rmk (pupa_mkimage_LDFLAGS): New variable.
1489
1490 * genmk.rb (Image#rule): Put LDFLAGS at the end of a line.
1491 (Utility#rule): Likewise.
1492
1493 * configure.ac: Check if LZO is available.
1494
ce5bf700 14952003-01-20 Yoshinori K. Okuji <okuji@enbug.org>
1496
1497 * include/pupa/normal.h: New file.
1498 * include/pupa/setjmp.h: Likewise.
1499 * include/pupa/i386/setjmp.h: Likewise.
1500 * normal/cmdline.c: Likewise.
1501 * normal/command.c: Likewise.
1502 * normal/main.c: Likewise.
1503 * normal/menu.c: Likewise.
1504 * normal/i386/setjmp.S: Likewise.
1505
1506 * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global.
1507 (pupa_rescue_cmd_initrd): Likewise.
1508
1509 * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader):
1510 Likewise.
1511
1512 * kern/i386/pc/startup.S (translation_table): New variable.
1513 (translate_keycode): New function.
1514 (pupa_console_getkey): Call translate_keycode.
1515
1516 * kern/rescue.c (attempt_normal_mode): New function.
1517 (pupa_enter_rescue_mode): Attempt to execute the normal mode. If
1518 it failed, print a message.
1519
1520 * kern/mm.c (pupa_real_malloc): Print more information when a
1521 free magic is broken.
1522 (pupa_free): If the first free header is not free actually, set
1523 it to P.
1524
1525 * kern/main.c (pupa_load_normal_mode): Just load the module
1526 "normal".
1527 (pupa_main): Don't print the message
1528 "Entering into rescue mode..." here.
1529
1530 * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd):
1531 Declared.
1532 (pupa_rescue_cmd_initrd): Likewise.
1533 (pupa_rescue_cmd_initrd): Likewise.
1534
1535 * include/pupa/symbol.h (FUNCTION): Specify the type.
1536 (VARIABLE): Likewise.
1537
1538 * include/pupa/err.h (pupa_err_t): Added
1539 PUPA_ERR_UNKNOWN_COMMAND.
1540
1541 * include/pupa/dl.h (pupa_dl_set_prefix): Exported.
1542 (pupa_dl_get_prefix): Likewise.
1543
1544 * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod.
1545 Added _chain.mod and _linux.mod instead of chain.mod and
1546 linux.mod.
1547 (chain_mod_SOURCES): Renamed to ...
1548 (_chain_mod_SOURCES): ... this.
1549 (chain_mod_CFLAGS): Renamed to ...
1550 (_chain_mod_CFLAGS): ... this.
1551 (linux_mod_SOURCES): Renamed to ...
1552 (_linux_mod_SOURCES): ... this.
1553 (linux_mod_CFLAGS): Renamed to ...
1554 (_linux_mod_CFLAGS): ... this.
1555 (normal_mod_SOURCES): New variable.
1556 (normal_mod_CFLAGS): Likewise.
1557 (normal_mod_ASFLAGS): Likewise.
1558
15592003-01-18 Yoshinori K. Okuji <okuji@enbug.org>
1560
1561 * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if
1562 possible.
1563
1564 * kern/dl.c (pupa_dl_ref): Refer dependending modules
1565 recursively.
1566 (pupa_dl_unref): Unrefer depending modules recursively.
1567 Don't call pupa_dl_unload implicitly, because PUPA can crash if
1568 a module is unloaded before one depending on that module is
1569 unloaded.
1570 (pupa_dl_unload): Unload depending modules explicitly,
1571 if possible.
1572
c04da074 15732003-01-17 Yoshinori K. Okuji <okuji@enbug.org>
1574
1575 * include/pupa/i386/pc/linux.h: New file.
1576 * loader/i386/pc/linux.c: Likewise.
1577
1578 * loader/i386/pc/chainloader.c (pupa_chainloader_boot_sector):
1579 Removed.
1580 (pupa_chainloader_unload): Return PUPA_ERR_NONE.
1581 (pupa_rescue_cmd_chainloader): Read the image to 0x7C00 instead
1582 of PUPA_CHAINLOADER_BOOT_SECTOR.
1583
1584 * kern/i386/pc/startup.S: Include pupa/machine/linux.h.
1585 (pupa_linux_prot_size): New variable.
1586 (pupa_linux_tmp_addr): Likewise.
1587 (pupa_linux_real_addr): Likewise.
1588 (pupa_linux_boot_zimage): New function.
1589 (pupa_linux_boot_bzimage): Likewise.
1590
1591 * kern/i386/pc/init.c (struct mem_region): New structure.
1592 (MAX_REGIONS): New macro.
1593 (mem_regions): New variable.
1594 (num_regions): Likewise.
1595 (pupa_os_area_addr): Likewise.
1596 (pupa_os_area_size): Likewise.
1597 (pupa_lower_mem): Likewise.
1598 (pupa_upper_mem): Likewise.
1599 (add_mem_region): New function.
1600 (compact_mem_regions): Likewise.
1601 (pupa_machine_init): Set PUPA_LOWER_MEM and PUPA_UPPER_MEM to
1602 the size of the conventional memory and that of so-called upper
1603 memory (before the first memory hole).
1604 Instead of adding each found region to free memory, use
1605 add_mem_region and add them after removing overlaps.
1606 Also, add only 1/4 of the upper memory to free memory. The rest
1607 is used for loading OS images. Maybe this is ad hoc, but this
1608 makes it much easier to relocate OS images when booting.
1609
1610 * kern/rescue.c (pupa_rescue_cmd_module): Removed.
1611 (pupa_enter_rescue_mode): Don't register initrd and module.
1612
1613 * kern/mm.c: Include pupa/dl.h.
1614
1615 * kern/main.c: Include pupa/file.h and pupa/device.h.
1616
1617 * kern/loader.c (pupa_loader_load_module_func): Removed.
1618 (pupa_loader_load_module): Likewise.
1619
1620 * kern/dl.c (pupa_dl_load): Use the suffix ``.mod'' instead of
1621 ``.o''.
1622
1623 * include/pupa/i386/pc/loader.h (pupa_linux_prot_size): Declared.
1624 (pupa_linux_tmp_addr): Likewise.
1625 (pupa_linux_real_addr): Likewise.
1626 (pupa_linux_boot_zimage): Likewise.
1627 (pupa_linux_boot_bzimage): Likewise.
1628
1629 * include/pupa/i386/pc/init.h (pupa_lower_mem): Declared.
1630 (pupa_upper_mem): Likewise.
1631 (pupa_gate_a20): Don't export, because turning off Gate A20 in a
1632 module is too dangerous.
1633
1634 * include/pupa/loader.h (pupa_os_area_addr): Declared.
1635 (pupa_os_area_size): Likewise.
1636 (pupa_loader_set): Remove the first argument. Loader doesn't
1637 manage modules or initrd any longer.
1638 (pupa_loader_load_module): Removed.
1639
1640 * conf/i386-pc.rmk (pkgdata_MODULES): Added linux.mod.
1641 (linux_mod_SOURCES): New variable.
1642 (linux_mod_CFLAGS): Likewise.
1643
a13f9237 16442003-01-07 Yoshinori K. Okuji <okuji@enbug.org>
1645
1646 * util/i386/pc/pupa-setup.c (setup): Convert the endianness of
1647 the length of a blocklist correctly.
1648
1649 * util/i386/pc/biosdisk.c (pupa_util_biosdisk_open) [__linux__]:
1650 Use ioctl only if the OS file is a block device.
1651 (pupa_util_biosdisk_open): Don't use ST.ST_BLOCKS, because it is
1652 not very useful for normal files.
1653
1654 * kern/main.c (pupa_set_root_dev): New function.
1655 (pupa_load_normal_mode): Likewise.
1656 (pupa_main): Call those above.
1657
1658 * include/pupa/types.h (pupa_swap_bytes16): Cast the result to
1659 pupa_uint16_t.
1660
1661 * include/pupa/kernel.h (pupa_enter_normal_mode): Removed.
1662
a5ffe966 16632003-01-06 Yoshinori K. Okuji <okuji@enbug.org>
1664
1665 * util/i386/pc/pupa-setup.c: Include pupa/machine/kernel.h.
1666 (setup): Configure the installed partition information and the
1667 dl prefix.
1668
1669 * loader/i386/pc/chainloader.c (my_mod): New variable.
1670 (pupa_chainloader_unload): New function.
1671 (pupa_rescue_cmd_chainloader): Refer itself.
1672 (PUPA_MOD_INIT): Save its own module in MY_MOD.
1673
1674 * kern/i386/pc/startup.S (install_partition): Removed.
1675 (version_string): Likewise.
1676 (config_file): Likewise.
1677 (pupa_install_dos_part): New variable.
1678 (pupa_install_bsd_part): Likewise.
1679 (pupa_prefix): Likewise.
1680 (pupa_chainloader_real_boot): Call pupa_dl_unload_all.
1681
1682 * kern/i386/pc/init.c: Include pupa/machine/kernel.h, pupa/dl.h
1683 and pupa/misc.h.
1684 (make_install_device): New function.
1685 (pupa_machine_init): Set the dl prefix.
1686
1687 * kern/rescue.c: Include pupa/rescue.h and pupa/dl.h.
1688 (buf): Renamed to ...
1689 (linebuf): ... this.
1690 (pupa_rescue_cmd_prefix): New function.
1691 (pupa_rescue_cmd_insmod): Likewise.
1692 (pupa_rescue_cmd_rmmod): Likewise.
1693 (pupa_rescue_cmd_lsmod): Likewise.
1694 (pupa_enter_rescue_mode): Register new commands: prefix, insmod,
1695 rmmod and lsmod.
1696
1697 * kern/mm.c (pupa_memalign): If failed even after invalidating
1698 disk caches, unload unneeded modules and retry.
1699
1700 * kern/misc.c (pupa_memmove): New function.
1701 (pupa_memcpy): Removed.
1702 (pupa_strcpy): New function.
1703 (pupa_itoa): Made static.
1704
1705 * kern/dl.c (pupa_dl_iterate): New function.
1706 (pupa_dl_ref): Likewise.
1707 (pupa_dl_unref): Likewise.
1708 (pupa_dl_unload): Return if succeeded or not.
1709 (pupa_dl_unload_unneeded): New function.
1710 (pupa_dl_unload_all): Likewise.
1711 (pupa_dl_init): Renamed to ...
1712 (pupa_dl_set_prefix): ... this.
1713 (pupa_dl_get_prefix): New function.
1714
1715 * include/pupa/i386/pc/kernel.h: Include pupa/types.h.
1716 (PUPA_KERNEL_MACHINE_INSTALL_DOS_PART): New macro.
1717 (PUPA_KERNEL_MACHINE_INSTALL_BSD_PART): Likewise.
1718 (PUPA_KERNEL_MACHINE_PREFIX): Likewise.
1719 (pupa_install_dos_part): Declared.
1720 (pupa_install_bsd_part): Likewise.
1721 (pupa_prefix): Likewise.
1722 (pupa_boot_drive): Likewise.
1723
1724 * include/pupa/types.h: Fix a typo.
1725
1726 * include/pupa/misc.h (pupa_memcpy): New macro. Just an alias to
1727 pupa_memmove.
1728 (pupa_memmove): Declared.
1729 (pupa_strcpy): Likewise.
1730
1731 * include/pupa/dl.h (PUPA_MOD_INIT): Change the prototype. Now
1732 pupa_mod_init takes one argument, its own module.
1733 (pupa_dl_unload_unneeded): Declared.
1734 (pupa_dl_unload_all): Likewise.
1735 (pupa_dl_ref): Likewise.
1736 (pupa_dl_unref): Likewise.
1737 (pupa_dl_iterate): Likewise.
1738 (pupa_dl_init): Renamed to ...
1739 (pupa_dl_set_prefix): ... this.
1740 (pupa_dl_get_prefix): Declared.
1741
1742 * fs/fat.c [!PUPA_UTIL] (my_mod): New variable.
1743 (pupa_fat_dir) [!PUPA_UTIL]: Prevent the fat module from being
1744 unloaded.
1745 (pupa_fat_open) [!PUPA_UTIL]: Refer itself if succeeded.
1746 (pupa_fat_close) [!PUPA_UTIL]: Unrefer itself.
1747
1748 * configure.ac (tmp_CFLAGS): Added -Wshadow, -Wpointer-arith,
1749 -Wmissing-prototypes, -Wundef and -Wstrict-prototypes.
1750
012d7999 17512003-01-03 Yoshinori K. Okuji <okuji@enbug.org>
1752
1753 * util/i386/pc/pupa-setup.c (setup): Define the internal
1754 function find_first_partition_start at the top level, because GCC
1755 3.0.x cannot compile internal functions in deeper scopes
1756 correctly.
1757 (find_root_device): Use lstat instead of stat.
1758 Don't follow symbolic links.
1759 Fix the path-constructing code.
1760
1761 * util/i386/pc/biosdisk.c [__linux__] (BLKFLSBUF): New macro.
1762 (pupa_util_biosdisk_open) [__linux__]: Get the size of a device
1763 by a BLKGETSIZE ioctl first, because block devices don't fill
1764 the member st_mode of the structure stat on Linux.
1765 [__linux__] (linux_find_partition): Use a temporary buffer
1766 REAL_DEV for the working space. Copy it to DEV before returning.
1767 (open_device) [__linux__]: Call ioctl with BLKFLSBUF to make the
1768 buffer cache consistent.
1769 (get_os_disk) [__linux__]: Use the length 5 instead of 4 for
1770 strncmp. The previous value was merely wrong.
1771 (pupa_util_biosdisk_get_pupa_dev): Use stat instead of lstat.
1772
1773 * fs/fat.c (pupa_fat_read_data): Shift 4 instead of 12 when the
1774 FAT size is 12. The previous value was merely wrong.
1775
1776 * kern/main.c (pupa_main): Don't split the starting message from
1777 newlines.
1778
1779 * kern/term.c (pupa_putchar): Put CR after LF instead of before
1780 LF, because BIOS goes crazy about character attributes in this
1781 case.
1782
1cc73a62 17832003-01-03 Yoshinori K. Okuji <okuji@enbug.org>
1784
1785 * include/i386/pc/util/biosdisk.h: New file.
1786 * util/i386/pc/biosdisk.c: Likewise.
1787 * util/i386/pc/pupa-setup.c: Likewise.
1788
1789 * Makefile.in (INCLUDE_DISTFILES): Added
1790 include/pupa/i386/pc/util/biosdisk.h.
1791 (UTIL_DISTFILES): Added biosdisk.c and pupa-setup.c under the
1792 directory util/i386/pc.
1793 (install-local): Added a rule for sbin_UTILITIES.
1794 (uninstall): Likewise.
1795
1796 * util/i386/pc/pupa-mkimage.c (usage): Fix a typo in the doc.
1797
1798 * util/misc.c (xrealloc): New function.
1799 (pupa_malloc): Likewise.
1800 (pupa_free): Likewise.
1801 (pupa_realloc): Likewise.
1802 (pupa_stop): Likewise.
1803 (pupa_putchar): Likewise.
1804
1805 * kern/disk.c (pupa_disk_read): Prevent L from underflowing.
1806
1807 * include/pupa/util/misc.h (xrealloc): Declared.
1808
1809 * include/pupa/i386/pc/boot.h (PUPA_BOOT_MACHINE_BPB_START): New
1810 macro.
1811 (PUPA_BOOT_MACHINE_BPBEND): Renamed to ...
1812 (PUPA_BOOT_MACHINE_BPB_END): ... this.
1813
1814 * include/pupa/fs.h [PUPA_UTIL] (pupa_fat_init): Declared.
1815 [PUPA_UTIL] (pupa_fat_fini): Likewise.
1816
1817 * fs/fat.c [PUPA_UTIL] (pupa_fat_init): Defined. Maybe a better
1818 way should be implemented.
1819 [PUPA_UTIL] (pupa_fat_fini): Likewise.
1820
1821 * disk/i386/pc/biosdisk.c (pupa_biosdisk_call_hook): Increase
1822 the size of NAME for safety.
1823 (pupa_biosdisk_iterate): Search hard disks to 0x90 instead of
1824 0x88.
1825
1826 * conf/i386-pc.rmk (sbin_UTILITIES): New variable.
1827 (pupa_setup_SOURCES): Likewise.
1828
1829 * genmk.rb (Utility#rule): Add $(BUILD_CFLAGS) into the rules.
1830
08b70fe8 18312002-12-28 Yoshinori K. Okuji <okuji@enbug.org>
1832
1833 * kern/i386/pc/startup.S (push_get_mmap_entry): Revert to a
1834 bunch of pushl's from pusha, because this destroys the return
1835 value.
1836
62ddcc8f 18372002-12-28 Yoshinori K. Okuji <okuji@enbug.org>
1838
1839 Use -mrtd and -mregparm=3 to reduce the generated code sizes.
1840 This means that any missing prototypes could be fatal. Also, you
1841 must take care when writing assembly code. See the comments at
1842 the beginning of startup.S, for more details.
1843
1844 * kern/i386/pc/startup.S (pupa_halt): Modified for the new
1845 compilation mechanism.
1846 (pupa_chainloader_real_boot): Likewise.
1847 (pupa_biosdisk_rw_int13_extensions): Likewise.
1848 (pupa_biosdisk_rw_standard): Likewise.
1849 (pupa_biosdisk_check_int13_extensions): Likewise.
1850 (pupa_biosdisk_get_diskinfo_int13_extensions): Likewise.
1851 (pupa_biosdisk_get_diskinfo_standard): Likewise.
1852 (pupa_get_memsize): Likewise.
1853 (pupa_get_mmap_entry): Likewise.
1854 (pupa_console_putchar): Likewise.
1855 (pupa_console_setcursor): Likewise.
1856 (pupa_getrtsecs): Use pushl instead of push.
1857
1858 * kern/i386/pc/init.c (pupa_machine_init): Use the scratch
1859 memory instead of the stack for a mmap entry, because some
1860 BIOSes may ignore the maximum size and overflow.
1861
1862 * conf/i386-pc.rmk (COMMON_CFLAGS): Added -mrtd and -mregparm=3.
1863
1864 * genmk.rb (PModule#rule): Compile automatically generated
1865 sources with module-specific CFLAGS as well as other sources.
1866
9962ed99 18672002-12-27 Yoshinori K. Okuji <okuji@enbug.org>
1868
1869 * configure.ac: Check ld.
1870 Replace CFLAGS and CPPFLAGS with BUILD_CFLAGS and BUILD_CPPFLAGS
1871 respectively, before checking endianness and sizes.
1872
1873 * Makefile.in (LD): New variable.
1874
abdfc3c5 18752002-12-27 Yoshinori K. Okuji <okuji@enbug.org>
1876
1877 * Makefile.in (BUILD_CC): CC -> BUILD_CC.
1878
6a161fa9 18792002-12-27 Yoshinori K. Okuji <okuji@enbug.org>
1880
1881 * Changelog: New file.
1882