EzDevInfo.com

boot

Build tooling for Clojure. Boot: build tooling for Clojure build tooling for clojure

How to start Solr automatically?

At the moment I have to go to /usr/java/apache-solr-1.4.0/example and then do:

java -jar start.jar

How do I get this to start automatically on boot?

I'm on a shared Linux server.


Source: (StackOverflow)

State of Registers After Bootup

This is a low level question. For a little bit of context, I'm working on a boot loader on an x86 machine.

When the BIOS copies the contents of the MBR to 0x7c00 and jumps to that address, is there a standard meaning to the contents of the registers? Do the registers have standard values?

I know that the segment registers are typically set to 0, but will sometimes be 0x7c0. What about the other hardware registers?

Thanks,

Terry


Source: (StackOverflow)

Advertisements

Getting started in creating simple bootable C program

Could someone guide me on what path/steps to take to create a simple bootable hello world program? I have the basic knowledge of C/C++.

My aim is to create a very simple OS.

I would like as much relevant links to references and samples as possible.


Source: (StackOverflow)

What is the booting process for ARM?

As we know, for X86 architecture: After we press the power button, machine starts to execute code at 0xFFFFFFF0, then it starts to execute code in BIOS in order to do hardware initialization. After BIOS execution, it use bootloader to load the OS image into memory. At the end, OS code starts to run. For ARM architecture, what is the booting process after use press the power button? Thanks!


Source: (StackOverflow)

How do I debug a slow rails app boot time?

Our rails app is nice and fast once it is loaded but the startup is brutally slow. Console, passenger etc all take almost 10 seconds to kick in. Seems to be way more than it should be.

What tools or methods should I use to hone in on the slowest parts? What are the usual suspects?


Source: (StackOverflow)

BroadcastReceiver not receiving BOOT_COMPLETED

I've looked around here for similiar problems, but for some reason my BroadcastReceiver never ends up receiving the android.intent.action.BOOT_COMPLETED Intent.

Here is my (relative) Android.Manifest File:

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"></uses-permission>    
<receiver android:name=".BootReceiver"
        android:enabled="true"
        android:exported="true"
        android:label="BootReceiver">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED"></action>

        </intent-filter>
    </receiver>

And Here is the actual Receiver.

public class BootReceiver extends BroadcastReceiver {
private static final String TAG="BootReceiver";

@Override public void onReceive(Context context,Intent intent){
    try{
        context.startService(new Intent(context,ConnectivityListener.class));
        Log.i(TAG,"Starting Service ConnectivityListener");
    }catch(Exception e){
        Log.e(TAG,e.toString());
    }
}
}

Thanks! Any help is greatly appreciated


Source: (StackOverflow)

The difference between initrd and initramfs?

As far as I know, initrd acts as a block device, thus requiring a filesystem driver (such as ext2). The kernel must have at least one built-in module for detecting filesystem of initrd. In this article, Introducing initramfs, a new model for initial RAM disks, it is written that:

But ramdisks actually waste even more memory due to caching. Linux is designed to cache all files and directory entries read from or written to block devices, so Linux copies data to and from the ramdisk into the "page cache" (for file data), and the "dentry cache" (for directory entries). The downside of the ramdisk pretending to be a block device is it gets treated like a block device.

What's page cache and dentry cache? In the paragraph, does it mean the data got duplicated because ramdisk is treated as a block device, thus all the data is cached?

In constrast, ramfs:

A few years ago, Linus Torvalds had a neat idea: what if Linux's cache could be mounted like a filesystem? Just keep the files in cache and never get rid of them until they're deleted or the system reboots? Linus wrote a tiny wrapper around the cache called "ramfs", and other kernel developers created an improved version called "tmpfs" (which can write the data to swap space, and limit the size of a given mount point so it fills up before consuming all available memory). Initramfs is an instance of tmpfs.

These ram based filesystems automatically grow or shrink to fit the size of the data they contain. Adding files to a ramfs (or extending existing files) automatically allocates more memory, and deleting or truncating files frees that memory. There's no duplication between block device and cache, because there's no block device. The copy in the cache is the only copy of the data. Best of all, this isn't new code but a new application for the existing Linux caching code, which means it adds almost no size, is very simple, and is based on extremely well tested infrastructure.

In sum, ramfs is just file opened and loaded into memory, isn't it?

Both initrd and ramfs are zipped at compile time, but the difference is, initrd is a block device unpacked to be mounted by the kernel at booting, while ramfs is unpacked via cpio into memory. Am I correct? Or is ramfs a very minimal file system?

Finally, up until this day, the initrd image is still presented in the latest kernel. However, is that initrd actually the ramfs used today and the name is just for historical purpose?


Source: (StackOverflow)

Run script with rc.local: script works, but not at boot

I have a node.js script which need to start at boot and run under the www-data user. During development I always started the script with:

su www-data -c 'node /var/www/php-jobs/manager.js

I saw exactly what happened, the manager.js works now great. Searching SO I found I had to place this in my /etc/rc.local. Also, I learned to point the output to a log file and to append the 2>&1 to "redirect stderr to stdout" and it should be a daemon so the last character is a &.

Finally, my /etc/rc.local looks like this:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

su www-data -c 'node /var/www/php-jobs/manager.js >> /var/log/php-jobs.log 2>&1 &'

exit 0

If I run this myself (sudo /etc/rc.local): yes, it works! However, if I perform a reboot no node process is running, the /var/log/php-jobs.log does not exist and thus, the manager.js does not work. What is happening?


Source: (StackOverflow)

Android - How to start an application on the /sdcard after boot

Is there a way how to start and android application after a boot automatically if it is on the /sdcard?

Ok, probably by BroadcastReceiver. But which action is the right one?

ACTION_BOOT_COMPLETED - does not work if it is on the /sdcard (documented)
ACTION_MEDIA_MOUNTED - does not work if it is on the /sdcard (which is undocumented)
ACTION_EXTERNAL_APPLICATIONS_AVAILABLE - does not work, I do not know why
ACTION_USER_PRESENT - does not work if the BroadcastReceiver is registered in AndroidManifest (which is undocumented, but documentation bug has been reported)

Thanks
Jan


Source: (StackOverflow)

What information does BIOS load into RAM?

I know that, on booting, BIOS loads the first sector (512 bytes) of a pre-defined device drive on memory 0x7c00 and then jump to that address.

So, memory from 0x7c00 to 0x7dff is occupied. Is there any other section of RAM that is occupied?

If I'm programming an Operating System, could I use all the RAM except 0x7c00 to ox7dff for my own purposes?, or, is there any other section filled with "precious" information at boot time that I must not overwrite?

I know that at a given moment, I can overwrite MBR loaded on memory (chainloading), my question is focused on... what part of the memory is available for an Operating System?

Sorry for my bad english. Thanks for your answers!!


Source: (StackOverflow)

How can I autorun Android Chrome homescreen app on startup

After adding a certain website to homescreen through Chrome for Android, I'm looking for a way to autorun that homescreen app as the device boots up. I found a few apps in the Google Play store that offer that behaviour but they don't list Chrome homescreen apps as possible to autorun on boot.

Any solution, anyone?


Source: (StackOverflow)

Flow of Startup code in an embedded system , concept of boot loader?

I am working with an embedded board , but i don't know the flow of the start up code(C/assembly) of the same.

Can we discuss the general modules/steps acted upon by the start up action in the case of an embedded system.

Just a high level overview(algorithmic) is enough.All examples are welcome.

/Kanu__


Source: (StackOverflow)

How does bootstrapping work for gcc?

I was looking up the pypy project (Python in Python), and started pondering the issue of what is running the outer layer of python? Surely, I conjectured, it can't be as the old saying goes "turtles all the way down"! Afterall, python is not valid x86 assembly!

Soon I remembered the concept of bootstrapping, and looked up compiler bootstrapping. "Ok", I thought, "so it can be either written in a different language or hand compiled from assembly". In the interest of performance, I'm sure C compilers are just built up from assembly.

This is all well, but the question still remains, how does the computer get that assembly file?!

Say I buy a new cpu with nothing on it. During the first operation I wish to install an OS, which runs C. What runs the C compiler? Is there a miniature C compiler in the BIOS?

Can someone explain this to me?


Source: (StackOverflow)

initrd and booting the Linux kernel

As I understand, initrd is a small image that is loadable in the RAM. It is used to boot a complete kernel with all the loadable modules. As part of the process, we need the vmlinuz kernel image which is a renamed version of bzImage.

Is it possible to boot the kernel without creating the initrd image?


Source: (StackOverflow)

Cron boot script only during certain times of the day

So I have a collection of scripts which are used to control my reciever and tv power during certain events like boot, screensaver, and remote control. One of these is executed during login but the thing is maybe I don't want it to run the script when the machine is scheduled to power up. I have the logic to ignore events if blanked = 0 during execution of startup apps, hence it wont send ir during boot or shutdown. How can I accomplish this through the use of cron? I choose cron because those events happen before startup applications. Cron is awesome but as far as I understand I can only run at boot or on a schedule not both. I need to script the time variable but I'm not sure how.

syson.sh (called during login as a startup app and screen state change)

#!/bin/sh
cd /home/gilson585/
blanked=`cat blanked`
if [ $blanked -eq 0 ] ; then
    blanked=1;echo $blanked > blanked
else
    irsend SEND_ONCE VR4085DF KEY_POWER;irsend SEND_ONCE Kenwood_RC-R0813 power;blanked=0;echo $blanked > blanked
    sleep 1
    irsend SEND_ONCE Kenwood_RC-R0813 cd/dvd
fi

sysoff.sh (called during shutdown as part of lirc init.d script and screen state change)

#!/bin/sh
cd /home/gilson585/
blanked=`cat blanked`
if [ $blanked -eq 0 ] ; then
    irsend SEND_ONCE Kenwood_RC-R0813 power;irsend SEND_ONCE VR4085DF KEY_POWER;blanked=1;echo $blanked > blanked
fi

xscreensaver.sh (screensaver watchdog, called during login)

#!/bin/bash
cd /home/gilson585/
xscreensaver-command -watch|
while read STATUS; do
  case "$STATUS" in
    BLANK*)
      /home/gilson585/sysoff.sh;blanked=1;echo $blanked > blanked
      ;;
    UNBLANK*)
      /home/gilson585/syson.sh;blanked=0;echo $blanked > blanked
      ;;
  esac
done

Source: (StackOverflow)