Hi Sourav,

thanks for sending us the patch. Please see my inline comments below.

On 03/05/2017 08:53 AM, sourav punoriyar wrote:

>=== modified file 'boot/arch/arm32/src/main.c'
>--- boot/arch/arm32/src/main.c 2015-10-06 20:23:44 +0000
>+++ boot/arch/arm32/src/main.c 2017-03-05 17:41:04 +0000
>@@ -82,12 +82,14 @@
>
> static bootinfo_t bootinfo;
>
>-void bootstrap(void)
>+
>+void bootstrap(char* boot_args)
> {
>       /* Enable MMU and caches */
>       mmu_start();
>       version_print();
>-      
>+      bootinfo.cmdline = boot_args;
>+

So in the loader you just save the pointer to the boot args for later
time...

>=== modified file 'kernel/arch/arm32/src/arm32.c'
>--- kernel/arch/arm32/src/arm32.c      2016-06-06 16:29:56 +0000
>+++ kernel/arch/arm32/src/arm32.c      2017-03-05 17:16:10 +0000
>@@ -63,7 +63,7 @@
>
> arch_ops_t *arch_ops = &arm32_ops;
>
>-
>+extern char boot_args[KERNEL_CMDLINE];
> /** Performs arm32-specific initialization before main_bsp() is
>called. */
> void arm32_pre_main(void *entry __attribute__((unused)), bootinfo_t
>*bootinfo)
> {
>@@ -77,6 +77,7 @@
>                   bootinfo->tasks[i].name);
>       }
>
>+    str_cpy(boot_args, KERNEL_CMDLINE, bootinfo->cmdline);
>       /* Initialize machine_ops pointer. */
>       machine_ops_init();
> }

...and during the kernel initialization you make the actual copy. Well,
this could theoretically work, if you are lucky. I mean the loader
allocates memory and unpacks the kernel, the init tasks and the RAM
disk. And under certain circumstances, the boot info structure can
overlap with these addresses. You should therefore make the copy of the
boot args already in the loader before any unpacking takes place.

As for the size limit, what does the u-boot say about it? I think a full
page size for boot args is more than enough, perhaps even 256 bytes
would do.

Jakub

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to