GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

Electric field of a single point-charge: The electric field …

Electric field of a single point-charge: The electric field  1.5 cm from a very small charged object points toward the object with a magnitude of 180,000 N/C. What is the charge on the object? (k = 1/4πε0 = 8.99 × 109 N ∙ m2/C2)

Read Details

. Resistivity: A cylindrical wire has a resistance R and res…

. Resistivity: A cylindrical wire has a resistance R and resistivity ρ. If its length and diameter are BOTH cut in half, (a) what will be its resistance? A)        4R B)        2R C)        R D)        R/2 E)        R/4

Read Details

Describe the Dopamine Hypothesis of Schizophrenia. Be detail…

Describe the Dopamine Hypothesis of Schizophrenia. Be detailed in your answer.

Read Details

Normal oxygen consumption (VO2) by the tissues in a minute i…

Normal oxygen consumption (VO2) by the tissues in a minute is approximately

Read Details

Students should fill in the sections marked /* TODO */. #inc…

Students should fill in the sections marked /* TODO */. #include #include #include #include #define MAX_SIZE 256static char kernel_vault[MAX_SIZE];static int message_len = 0;/* * Function called when you ‘echo’ to the device * Should ENCRYPT the data (+1) before storing it */ssize_t vault_write(struct file *file, const char __user *buf, size_t count, loff_t *pos) {    int i;    message_len = (count < MAX_SIZE) ? count : MAX_SIZE - 1;    if (copy_from_user(kernel_vault, buf, message_len)) {        return -EFAULT;    }    // TODO: Loop through kernel_vault and shift characters +1    // Hint: Check if character is between 'a'-'y' or 'A'-'Y' before adding 1    // Handle 'z' and 'Z' separately to wrap them to 'a' and 'A'    printk(KERN_INFO "Vault: Data encrypted and stored.\n");    return count;}/* * Function called when you 'cat' the device * Should DECRYPT the data (-1) before showing it to user */ssize_t vault_read(struct file *file, char __user *buf, size_t count, loff_t *pos) {    static int completed = 0;    char decrypt_temp[MAX_SIZE];    int i;    if (completed) {         completed = 0;         return 0;     }    if (message_len == 0) {        char *empty = "Vault is empty.\n";        copy_to_user(buf, empty, strlen(empty));        completed = 1;        return strlen(empty);    }    // Copy to a temp buffer so we don't ruin the encrypted data in the vault    memcpy(decrypt_temp, kernel_vault, message_len);    // TODO: Loop through decrypt_temp and shift characters -1    // Hint: (char - 'a' - 1 + 26) % 26 + 'a' handles the wrap-around safely    if (copy_to_user(buf, decrypt_temp, message_len)) {        return -EFAULT;    }    completed = 1;    return message_len;}static struct proc_ops v_ops = {    .proc_read = vault_read,    .proc_write = vault_write,};int init_module(void) {    proc_create("vault", 0, NULL, &v_ops);    printk(KERN_INFO "Vault Module Loaded.\n");    return 0;}void cleanup_module(void) {    remove_proc_entry("vault", NULL);    printk(KERN_INFO "Vault Module Unloaded.\n");}MODULE_LICENSE("GPL");

Read Details

The total amount of oxygen delivered to the tissues is depen…

The total amount of oxygen delivered to the tissues is dependent on which of the following?                                               1.     Cardiac output (QT)                                               2.     Hemoglobin                                                3.     SaO2                                               4.     Body Temperature

Read Details

The Secure Kernel Vault 1. Background: What is a Caesar Ciph…

The Secure Kernel Vault 1. Background: What is a Caesar Cipher? The Caesar Cipher is one of the oldest and simplest encryption techniques. It is a substitution cipher where each letter in the original message (plaintext) is replaced by a letter some fixed number of positions down the alphabet. In this assignment, we will use a Shift of 1: Enciphering (Writing to Kernel): We move +1 forward. (‘A’ becomes ‘B’, ‘h’ becomes ‘i’). Deciphering (Reading from Kernel): We move -1 backward. (‘B’ becomes ‘A’, ‘i’ becomes ‘h’). Example: Input: Hello Stored in Kernel (Scrambled): Ifmmp Output to User: Hello 2. Your Task Create a Loadable Kernel Module (LKM) that manages a /proc/vault entry. Your module must: On Write: Receive a string from the user, shift every alphabetic character by +1, and store it in a kernel buffer. On Read: Take the scrambled string, shift every character back by -1, and display the original message to the user. Persistence: The scrambled message should remain in memory until a new write overwrites it. 3. Implementation Requirements Use copy_from_user and copy_to_user for safe data transfer. Use a buffer of size 256 to store the message. Implement the “completed” toggle logic in proc_read to prevent cat from looping infinitely. Circular Logic: If a user writes ‘z’, it should wrap around to ‘a’. 4. Testing Steps for Students Compile and Insert: Run make and sudo insmod vault.ko. Write Data: Run echo “Attack at Dawn” > /proc/vault. Check Scrambled Data: Run dmesg | tail. Print Sramble text in Kernel log: Add a printk in write to show the scrambled string. Read Data: Run cat /proc/vault. It should correctly show Attack at Dawn.

Read Details

Bacteria that are difficult to cultivate due to special nutr…

Bacteria that are difficult to cultivate due to special nutritional needs are termed  

Read Details

A site on an enzyme other than the active site that can bind…

A site on an enzyme other than the active site that can bind molecules and influence the shape of the active site is referred to as a(n) ________.

Read Details

What is the primary function of transfer RNA (tRNA)?

What is the primary function of transfer RNA (tRNA)?

Read Details

Posts pagination

Newer posts 1 … 25 26 27 28 29 … 77,321 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top