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