Posts
3562
Following
214
Followers
361
Linux kernel maintainer. Compilers and virtualization at Parity Technologies.

@mpdesouza So I did a kernel workaround in .config/helix/languages.toml:

[[language]]
name = "c"
indent = { tab-width = 8, unit = "\t" }

:-) I mean I rarely use anything else than kernel convention for any C code not a big deal… Still would be nice to have editorconfig eventually for some contribution or something.

For using compile_commands.json with kernel this the workflow I’ve ended up with:

make ARCH=x86_64 O=./.clangd x86_64_defconfig                                       
make ARCH=x86_64 O=./.clangd menuconfig
make ARCH=x86_64 O=./.clangd -j`nproc`
scripts/clang-tools/gen_compile_commands.py -d ./.clangd

This way it does not confuse e.g. BuildRoot when I point out my BuildRoot with LINUX_OVERRIDER_SRCDIR to my local kernel tree. Not sure if there is better way to do this but feels like a working workflow in my case.

Nice to see some real innovation with Rust in text editors instead pwning the GPU or similar features. If you editor will not work in terminal, it will end up sucking in the end, as far as I’m consdered :-) Not minding of having also GUI but first things first…

1
0
0
@rolle propsit muuten jäbän irssi-teemasta, tuli tämmöinen ihan vahingon kautta vastaan: https://github.com/ronilaukkarinen/weed !
1
0
2
@rolle.wtf@bsky.brid.gy @rolle tää taas on vähän niin kuin usenet tai sitä ennen fidonet (muinaisina BBS-aikoina). semmoista kirjavampaa keskustelua ja näkemystä, ei niin poliittisten suuntausten dominoimaa.
1
0
1
@rolle.wtf@bsky.brid.gy @rolle jos jonkun somen poistasin vielä niin bsky olis ekana tappolistalla ;-) se on vähän niin kuin vasemmiston twitter ja X on oikeiston twitter. siirrytty kahteen hiekkalaatikkoon.
1
0
1

Jarkko Sakkinen

Edited 1 month ago
@wren3n also vim already had too many features, so for it never made sense to break the old ones and pile bunch of new ones on top... it is called inconsistency in my books :-) making something completely new from clean slate is something i get much better. and for terminal.
0
0
1
@Conan_Kudo @fedora I use VisionQuest2 for baremetal kernel testing :-) I think you saw the screenshot that I put while ago: https://social.kernel.org/notice/AnfOy9iKK7ZP1YNvfc

It's pretty cool setup and even has outboard gear (a real TPM2 chip) connected :-) I use it in kernel testing by build image with BuildRoot.

For any RISC-V board used for development I'd recommend to download its user guide and search if it can be put into SDIO boot mode with e.g. some PIN switches. That means that you can have the whole boot chain in SD card including U-boot and OpenSBI.
0
0
0
@wren3n it breaks the bits that i actually use :-) e.g. elevated commands (you can sudo in ex) and remotes. and plugins often makes it not work like vim i.e. make it something else than vim is. i've been a vim user since 1998 so in that time you get into habbits :-) actually a completely new thing but still modal is easier to get off those habbits. it's totally subjective thing really.
1
0
1
@dngrs thanks for responses. you're always beginner in something :-)
1
0
0
@mpdesouza different key strokes is not that confusing after a while. i still love (non-neo) vim for raw text editing, and different strokese actually help me to be aware which editor I'm using ATM :-) and helix has very intuitive contextual help system.

There's also PR for editorconfig so I guess that some day that will land too https://github.com/helix-editor/helix/pull/1777/

Plugin systems sort of make everything as a programming language. I like the simplicity of "opionated" features even if one knob that i'd like to be there is missing. It also gives guaranteed ubiquitos UX when i login to different systems as everything has the "same plugins".
1
0
0

Jarkko Sakkinen

With Rust I've accepted the reality that I cannot simply survive with plain Vim. So using more and more Helix with that. I don't GUI and I dislike NeoVim so Helix has started to stick on me over the last year more and more.

One feature that I like a lot in Helix is "no plugins" ;-) That's fresh. One thing that I wished it had, and thus not applicable for kernel development, is the support for ".editorconfig". Once it has that I can try to write a kernel patch with it.

#helix #vim #editor
3
1
6
@FSMaxB thanks i learned a lot from your answers! highly appreciate this!
0
0
1
@FSMaxB i'm not sure what i'm doing exactly yet i.e. learning ;-)
0
0
0
@SeanOMik I rarely use Arc, and rather end up using e.g. RwLock or something. It does not end up to be the best option often in the end. So yeah have to admit that it is also fuzzy... And I really just don't get so far any of the cell types. I can admit that I don't understand them :-)
2
1
0
@FSMaxB better to stop spamming here :-) anyway this was the best documentation for me ever for cells: "noalias/restrict". That nails them...
0
0
0

@FSMaxB Found a pattern for my current problem that compiles and works.

Creation:

        let vmctx = RwLock::new(unsafe { Arc::from_raw(vmctx_mmap.as_mut_ptr().cast::<VmCtx>()) });

Example use:

            Arc::get_mut(&mut self.vmctx.write().unwrap()).unwrap().regs[reg as usize] = value;

This whole topic gained my interest because I incorrectly first used Box here. In this case Arc is the solution because it does “just drop” instead of “drop + free” (Box).

1
0
0

Jarkko Sakkinen

Edited 1 month ago

@FSMaxB I solve that by

  1. vmctx: *mut VmCtx
  2. vmctx: RwLock::new(unsafe { vmctx_mmap.as_mut_ptr().cast::<VmCtx>() }),

Not pretty but this at least works :-) If there is some day something nicer that I get I’ll fix it up…

1
0
0

Jarkko Sakkinen

Edited 1 month ago

@FSMaxB This actually did not work

$ cargo b
warning: /home/jarkko/work/github.com/jarkkojs/polkavm/Cargo.toml: unused manifest key: workspace.lints.rust.unexpected_cfgs.check-cfg
   Compiling polkavm v0.15.0 (/home/jarkko/work/github.com/jarkkojs/polkavm/crates/polkavm)
error[E0308]: mismatched types
    --> crates/polkavm/src/sandbox/linux.rs:1596:13
     |
1596 |             vmctx,
     |             ^^^^^ expected `RwLock<VmCtx>`, found `RwLock<&mut VmCtx>`
     |
     = note: expected struct `RwLock<VmCtx>`
                found struct `RwLock<&mut VmCtx>`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `polkavm` (lib) due to previous error

I’m sure I can solve it just putting a note in order to not spread FUD ;-)

1
0
0
@dngrs OK fair enough. I rarely have anything with multiple owners. That is a good example I think thanks! I get that.

Cell types are still totally alien topic but maybe that will uncover some day :-)
1
1
0
@dngrs Someone explained me "in C" what UnsafeCell is: it is like restrict + noalias in C compiler set to a pointer. And it is mostly for constructing other Cell entities. So yeah now I get much better what they are :-)
1
0
1
Show older