2020年6月26日 星期五

Qualcomm Snapdragon LTE modem


4G X-series Modem Class X5 X7 X12
LTE Category (down / up) 4 6 12/13
Peak LTE speeds down (Mbit/s) 150 300 600
Peak LTE speed up (Mbit/s) 50 50 150
LTE Class LTE (4G) LTE Advanced (4G+)
Modems MDM9628 MDM9635M MDM9645
MDM9625 MDM9235M MDM9640
MDM9320 MDM9630 MDM9340
MDM9225 MDM9330 MDM9245
  MDM9230 MDM9240


5G X-series Modem Class X50 X55
LTE Category (down / up) N/A 22
Peak LTE speeds down (Mbit/s) 2500
Peak LTE speed up (Mbit/s) 316
LTE Class LTE Advanced Pro (4.5G)
5G Modes NSA, TDD FDD, NSA, SA, TDD
Peak 5G speeds down (Mbit/s) 6500 7500
Peak 5G speeds up (Mbit/s) ? 3000


    參考資料:
  • https://en.wikipedia.org/wiki/Qualcomm_Snapdragon_LTE_modem, Qualcomm Snapdragon LTE modem



2020年5月9日 星期六

Linux Kernel(18.2)- SysCall mount


簡單記錄一下Linux 4.19-rc8從mount system call到呼叫file_system_type.mount()的call flow
SYSCALL_DEFINE5(mount)
  |--> ksys_mount()
    |--> do_mount()
      |--> do_new_mount()
        |--> type = get_fs_type()
        |--> vfs_kern_mount(type)
          |--> mount_fs(type)
            |--> type->mount()


SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name,
        char __user *, type, unsigned long, flags, void __user *, data)
{
    return ksys_mount(dev_name, dir_name, type, flags, data);
}

int ksys_mount(char __user *dev_name, char __user *dir_name, char __user *type,
        unsigned long flags, void __user *data)
{
  int ret;
  char *kernel_type;
  char *kernel_dev;
  void *options;

  kernel_type = copy_mount_string(type);
  ...

  kernel_dev = copy_mount_string(dev_name);
  ...

  options = copy_mount_options(data);
  ...

  ret = do_mount(kernel_dev, dir_name, kernel_type, flags, options);
  ...
  
  return ret;
}

long do_mount(const char *dev_name, const char __user *dir_name,
  const char *type_page, unsigned long flags, void *data_page)
{
  struct path path;
  unsigned int mnt_flags = 0, sb_flags;
  int retval = 0;

  retval = user_path(dir_name, &path);

  if (flags & MS_REMOUNT)
    retval = do_remount(&path, flags, sb_flags, mnt_flags, data_page);
  else if (flags & MS_BIND)
    retval = do_loopback(&path, dev_name, flags & MS_REC);
  else if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
    retval = do_change_type(&path, flags);
  else if (flags & MS_MOVE)
    retval = do_move_mount(&path, dev_name);
  else
    retval = do_new_mount(&path, type_page, sb_flags, mnt_flags, dev_name, data_page);
  ...

  return retval;
}

static int do_new_mount(struct path *path, const char *fstype, int sb_flags,
   int mnt_flags, const char *name, void *data)
{
  struct file_system_type *type;
  struct vfsmount *mnt;
  int err;

  type = get_fs_type(fstype);
  ...

  mnt = vfs_kern_mount(type, sb_flags, name, data);
  ...

  put_filesystem(type);
  ...
  err = do_add_mount(real_mount(mnt), path, mnt_flags);
  ...
  return err;
}

struct vfsmount *
vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void *data)
{
  struct mount *mnt;
  mnt = alloc_vfsmnt(name);
  ...

  root = mount_fs(type, flags, name, data);
  ...
  return &mnt->mnt;    
}

struct dentry *
mount_fs(struct file_system_type *type, int flags, const char *name, void *data)
{
  struct dentry *root;
  ...

  root = type->mount(type, flags, name, data)
  ...

  return root;
}



    參考資料:
  • https://lkml.org/lkml/2018/3/16/905, fs: add ksys_mount() helper; remove in-kernel calls to sys_mount()
  • https://www.halolinux.us/kernel-architecture/the-mount-system-call.html, The Mount System Call




2020年5月3日 星期日

Yocto Project Reference Manual - extrausers.bbclass


extrausers.bbclass這個class允許我們在image中加入新的userand group,透過EXTRA_USERS_PARAMS 來設定,如:
新增兩個user,"tester-jim"與"tester-sue" ,其密碼都是tester01
     inherit extrausers
     EXTRA_USERS_PARAMS = "\
         useradd -P tester01 tester-jim; \
         useradd -P tester01 tester-sue; \
         "

也可以用於變更(設定)密碼
     inherit extrausers
     EXTRA_USERS_PARAMS = "\
         usermod -P 1876*18 root; \
         "

更複雜的例子如下
     inherit extrausers
     EXTRA_USERS_PARAMS = "\
         useradd -p '' tester; \
         groupadd developers; \
         userdel nobody; \
         groupdel -g video; \
         groupmod -g 1020 developers; \
         usermod -s /bin/sh tester; \
         "


    參考資料:
  • https://www.yoctoproject.org/docs/1.8/ref-manual/ref-manual.html#ref-classes-extrausers, extrausers.bbclass




熱門文章